Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, there!
I've got a question about the methods GeometryInstance.GetInstanceGeometry() and GeometryInstance.GetSymbolGeometry().
In my file I've got only one imported dwg with only one line inside it.
There is a code below that i use to test:
var reference = _selection.PickObject(ObjectType.PointOnElement);
var element = _doc.GetElement(reference);
var options = new Options();
options.ComputeReferences = true;
options.View = _doc.ActiveView;
var geometryElement = element.get_Geometry(options);
var geometryInstance = geometryElement
.FirstOrDefault(x => x is GeometryInstance) as
GeometryInstance;
var instanceGeometry = geometryInstance?.GetInstanceGeometry();
var instanceCurve=instanceGeometry?.FirstOrDefault(x => x is Curve) as Curve;
var instanceReference = instanceCurve?.Reference;
var instanceRepresentation = instanceReference?.ConvertToStableRepresentation(_doc);
var symbolGeometry = geometryInstance?.GetSymbolGeometry();
var symbolCurve=symbolGeometry?.FirstOrDefault(x => x is Curve) as Curve;
var symbolReference = symbolCurve?.Reference;
var symbolRepresentation = symbolReference?.ConvertToStableRepresentation(_doc);
After the execution I've received that:
instanceRepresentation=e558d96b-a4b0-449d-a84e-00d8c2768a5c-00000a38:2:1:LINEAR
symbolRepresentation=e558d96b-a4b0-449d-a84e-00d8c2768a5c-00000c0f:0:INSTANCE:e558d96b-a4b0-449d-a84e-00d8c2768a5c-00000a38:2:1:LINEAR
where e558d96b-a4b0-449d-a84e-00d8c2768a5c-00000a38 - is uniqueId for CADLinkType
and e558d96b-a4b0-449d-a84e-00d8c2768a5c-00000c0f - is uniqueId for ImportInstance.
For me, it seems like these two results were mixed up. Looks like "instanceRepresentation" refers to symbol geometry, while "symbolRepresentation" refers to instance geometry.
I will be grateful for any help.
Solved! Go to Solution.