Community
string objIdStr = someObj.ObjectId.Tostring();//after this code objIdStr = "(1234)", where 1234 - id of the object.
string pureObjId = objectId.Trim(new char []{ '(', ')'});//removes '(' and ')'. it's need to convert this string to int
ObjectId objId = new ObjectId(Convert.ToInt32(pureObjId));//create ObjectId with defined id
public static ObjectId GetObjectId(this Database db, string handle) { Handle h = new Handle(Int64.Parse(handle, NumberStyles.AllowHexSpecifier)); ObjectId id = ObjectId.Null; db.TryGetObjectId(h, out id);//TryGetObjectId method return id; }
Can't find what you're looking for? Ask the community or share your knowledge.