Please tell me how to get the name of the part in the assembly (or component) when choosing its edge?
Please tell me how to get the name of the part in the assembly (or component) when choosing its edge?
Hello,
Use GetComponent method
2017 SOLIDWORKS API Help - Get Component for Selected Entity Example (VBA)
Hi Evgenij Polupan
2017 SOLIDWORKS API Help - GetComponent Method (IEntity)
You can use ISelectionMgr::GetSelectedObject6 to get the selected object in the assembly, then use the entity object representing that face or edge object to call this method.
This method works only when you get the IEntity object directly from the assembly document or from an assembly entity that is displayed in a drawing document.
2017 SOLIDWORKS API Help - Name2 Property (IComponent2)
This property returns a name that includes an instance number. For example:
Part1-1
indicates that this is the first instance of the Part1 Component2. If you are examining a component that is within a subassembly, then this property returns a name that includes the full hierarchical path of component names. For example:
subAssem1-2/Part1-1
indicates that this component (Part1) is the first instance within the subAssem1 Component2. It also shows that the second instance of subAssem1 is referenced.