Topic: SOLIDWORKS API: Get Reference Data (Entity Type, Name, Model) from a Selected Reference Dimension
Problem Summary:
I am trying to develop a macro that extracts the underlying reference data from a manually selected Reference Dimension (RD) on a drawing sheet. While I can access the dimension object itself,
I am struggling to programmatically "drill down" to the specific entities it references in the 3D model.
Current Approach & Roadblock:
I am currently using SelectionManager.GetSelectedObject6 to get the IDisplayDimension. I can get basic info like the dimension name and value using GetAnnotation and GetDimension,
but I cannot find a direct method to return the array of entities or the IEntity objects that the dimension is attached to in the drawing view context.
What I need to retrieve:
For a selected IDisplayDimension, I need to find:
Reference Type: (e.g., Edge, Vertex, Sketch line, point etc.).
Reference Entity Name: The internal or assigned name of the referenced entity.
Model Reference Name: The name of the part or assembly file the dimension is referencing.
Request:
Does anyone have a code snippet or can point me to the correct interface (e.g., IView, IDrawingDoc, or a specific property of IDimension) that exposes the referenced geometry of a drawing dimension?
