Make linked block

Hi all,
I’ve searched everywhere but I have not found any topic about creating linked blocks,
for some reason I need to make linked instanceDefinitions, so I would be so thankful if you help me with that.

Here a very old RVB file that may point you in the direction. You should be able to get the gist of the script and convert it to RhinoCommon

1 Like

Thanks a lot Nathan,
that’s very helpful :+1:

I also Found this one:

string blockname = "test";
string path = "the path of block geometries to be saved" + blockname + ".3dm";
var doc = RhinoDoc.ActiveDoc;

Circle my_circle = new Circle(Plane.WorldXY, new Point3d(0, 0, 0), 5);
Guid circle_ID = doc.Objects.AddCircle(my_circle);
var circle_obj = doc.Objects.FindId(circle_ID).Geometry;
var defindex = doc.InstanceDefinitions.Add(blockname, "testdescription", new Point3d(0, 0, 0), circle_obj, oa);
doc.InstanceDefinitions.ModifySourceArchive(defindex, path, InstanceDefinitionUpdateType.Linked, false);
1 Like