GeometricConstraints Object

GeometricConstraints Object

Anonymous
Not applicable
300 Views
2 Replies
Message 1 of 3

GeometricConstraints Object

Anonymous
Not applicable
I'm was trying to write a macro to remove all of the geometric contraints from a Title Block sketch and I noticed something odd. The Count property wasn't returning the number of constraints on my sketch - it was reporting more. What's more, I couldn't delete several of the constraints, even though their Type seemed normal - some were Coincident and some were Parallel.

I finally got all of the 'actual' constraints deleted (the ones that actually appeared when I showed constraints on the sketch elements) and I still had those few extra constraints being reported by the GeometricConstraints object.

Is anyone familiar with this object and what is happening? I have another TB sketch with several thousand constraints (imported from ACAD) that I'd like to use this macro to remove, but it is leaving behind many hundreds instead of just a few.
0 Likes
301 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
There are several geometric constraints on a sketch that are not visible to the end user. For instance, if there is just a line in the sketch, there are 2 coincident constraints (one between the line and start sketch point and the other between the line and the end point). These are not visible to the end user (so the 'Show All Constraints' won't show these), but the API collection picks up these constraints as well. And such "internal" constraints cannot and should not be deleted. Perhaps the API can do better in identifying such constraints using a special property and/or failing on the Delete method. But unfortunately, there currently isn't a way to identify them. Sanjay- "ForrestJudd1" wrote in message news:27049878.1108320430078.JavaMail.jive@jiveforum2.autodesk.com... > I'm was trying to write a macro to remove all of the geometric contraints from a Title Block sketch and I noticed something odd. The Count property wasn't returning the number of constraints on my sketch - it was reporting more. What's more, I couldn't delete several of the constraints, even though their Type seemed normal - some were Coincident and some were Parallel. > > I finally got all of the 'actual' constraints deleted (the ones that actually appeared when I showed constraints on the sketch elements) and I still had those few extra constraints being reported by the GeometricConstraints object. > > Is anyone familiar with this object and what is happening? I have another TB sketch with several thousand constraints (imported from ACAD) that I'd like to use this macro to remove, but it is leaving behind many hundreds instead of just a few.
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thanks so much for your reply. It makes sense what they are at least...I can work around them a little better now that I know what they are.
0 Likes