API: getting 3d entities info from their Drawing counterpart

I have been asked to write an add-in that does this: loop through the entities of a drawing view and for each of them get the associated 3d entity (typically an edge)

I have no Solidworks API skills. Looking at the documentation and the available examples I have inferred that I can easily access entities in a drawing view calling IGetPolylines5. The problem is that I could not find how to associate each of these lines, arcs, etc. to their corresponding 3d edges (or even to the related features)

This info seems to be available for driven dimensions (Annotation::GetAttachedEntities2) while this apparently does not work for driving dimensions as they don't return any associated entity.

Could someone please help me ?

Thanks in advance

Reply to
zinedine
Loading thread data ...

I have been asked to write an add-in that does this: loop through the entities of a drawing view and for each of them get the associated 3d entity (typically an edge)

I have no Solidworks API skills. Looking at the documentation and the available examples I have inferred that I can easily access entities in a drawing view calling IGetPolylines5. The problem is that I could not find how to associate each of these lines, arcs, etc. to their corresponding 3d edges (or even to the related features)

This info seems to be available for driven dimensions (Annotation::GetAttachedEntities2) while this apparently does not work for driving dimensions as they don't return any associated entity.

Could someone please help me ?

Thanks in advance

Reply to
zinedine

I have this to say: good luck!

I looked at doing this a few years ago, so I don't know if there have been any improvements in the API to help with this. What I found is that there is really no easy and straightforward way to do this. The best solution that I could come up with was to get the sketch entities and the 3d model edge entities and then use the model to drawing transform to mathematically compute which edge matched up to which sketch entity. Not too fun. In the end I never implemented this because we decided that it was not worth it.

If you come up with anything better, let me know.

Jonathan Anderson

Reply to
Jonathan Anderson

Before we focus on the solution, can I ask what you are looking to achieve with this add-in?

Best Regards,

Bob Hanson Senior SW API Solutions Developer Centare Group Ltd.

formatting link

Reply to
Bob Hanson

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.