Connected drawing curve selection - select by window?

Connected drawing curve selection - select by window?

gerrardhickson
Collaborator Collaborator
253 Views
3 Replies
Message 1 of 4

Connected drawing curve selection - select by window?

gerrardhickson
Collaborator
Collaborator

Hi All,


I want to implement some kind of crude feature detection for drawing views - to do this, I need to look for patterns in the drawing curves. Unfortunately the curve object does not contain any information about connected curves, and it's not in order. So I need a way to detect a chain of curves.

 

One option is to build a collection that contains a custom class - which itself contains one drawing curve, and a collection of connected curves. This option requires me to iterate through each object by the square of the number of curves, which could take a long time.

 

Another option is to look for one type of curve in a particular pattern and then perform a window select around its end points and then check the curves that it finds - this is the subject of my question.


How do I perform a window selection or selection by points in VBA drawing environment? I haven't been able to find anything that suggests that its possible other than a method using a hackish mouse events method.

 

Suggestions also welcome on the feature detection problem too.


Thanks in Advance.

0 Likes
254 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor

Hi @gerrardhickson.  Maybe I am thinking in a completely different direction than what you had in mind, but what about using the DrawingView.DrawingCurves property to return the DrawingCurvesEnumerator containing the curves associated with the PartFeature (or similar) that you specify as input into the DrawingView.DrawingCurves call?  Yes, it would involve digging into the model document being referenced by the view, so it can be a bit complicated, but still sounds easier than trying to find connected patterns of geometry within the view.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 4

gerrardhickson
Collaborator
Collaborator

Hi @WCrihfield ,

 

Thanks for the suggestion, I'll check that out.

0 Likes
Message 4 of 4

gerrardhickson
Collaborator
Collaborator

@WCrihfield, I looked into this a little bit - I think I understand what's going on.


In my case, I'm trying to look for features on a sheetmetal flat pattern view - the problem is that in the flat pattern model, these features aren't referable - meaning I can't select them using feature priority. All faces just appear to have the model as the parent - not a body, feature or other object. I think this option will work well for folded models though, I'm keen to explore this further as I need it.

I did eventually figure out a way to detect a feature using the drawing curves, just by iterating through them looking for the most distinct curve, then iterating through them looking for adjoining curves until the pattern had been successfully (or not successfully) detected. I thought this iterating through method would take a long time, but it's faster than I expected. For now, I'll keep going, but still keen for a better method.

0 Likes