This may be a bit advanced, but I REALLY want to get programatic control over parametric constraints (acad 2011). I have created a dynamic block with all these constraints, but now I want to create the block from near scratch all in code. You see there will be some general common elements and then some random per project elements, that I need to set some simple constraints within the block. (Coincident, Tangent, Aligned-dimension).
I have read the arx guide at Developer Guide / Advanced Topics / Associative Framework, and I actually understood most of it this time! It would be REALLY nice if anybody had an example of how to use this system (managed or not, for I am a vb.net developer at first). I have searched around and find nobody is programming to parametric constraints and telling about it. Please help.
Solved! Go to Solution.
I am responding because no one else did. I haven't had the time to get into Dynamic blocks yet.
That said, there is a post on Through The Interface which deals with accessing Dynamic properties, here:
It was written using 2009 Acad, and Kean specifically replies to a Comment saying that there is (was) no API exposed for manipulating a Dynamic Block Definition, only references. I took a quick look through my object browser in 2010, and I don't see anything there either, so unless this API is newly exposed in 2011, you may be out of luck.
I would suggest going to the TTIF post and leaving a comment for Kean, asking if this is still the case.
Hello chief, long time no read...
Yea some 2 years ago, I did a project with dynamic blocks and have a good handle on the concept. Its the Parametric Constraints (Inventor's sketch constraints, such as a tangent constraint between a circle and a line), that came in with 2010, that I don't have an API for. Several other guru's have complain about this as well, but has anybody figured something out?
I do not have a job, so have a lot of time to play, with the api...
I have done some commands in ObjectARX with this... and have tried to port it into C#. Can't post the whole code, but to give an idea, attached it is an image of some portion of my code, and yes there is nothing open et-al that one can find, that you can use as a guide.
Just to fill my curiosity, any of you work as a programmer, doing AutoCAD based applications? using C++, ARX, MFC, Custom Objects, C#, etc? for a software or an architectural/engineering company ? - or - it is just a hobby.
As a CAD Manager (3 to 35 size CAD Staff(s)) I've been programming professionally (various languages and platforms) for 6 years, and 3 companies now. ALL Learned the hard way (unless I get a good book)! Once they find out what can be done, they begin to ask for very advanced tools. I'll take a look at your code, and see what I can make of it.
This is wrapped in VB.Net and I can use the classes in vb! One quick question tho, what is the purpose of "MyDict" string name of an NOD dictionary? Is that a custom dictionary or is there a standard dictionary (already named) I need to find?
I'm all over this, hopefully soon I'll be able to hand the community some functional tools.
I frequent this site:
And just noticed, and appears there it is now a sample about it from a class at the AU2010 by Stephen Preston.
Creating Geometric and Dimensional Constraints Using the AutoCAD® .NET API
Now that hit the spot! From Stephen's work I have a full belly of code examples, starter video and text to digest for weeks. Like a loaded turkey dinner followed by a table full of deserts, with a honey cured ham dinner the next day, and a smoked BBQ dinner after that... I will be re-arranging some of the code Stephen wrote to fit my design principals, but for any beginner there's loads of copy+paste goodies ready to use. Thank you everybody!
Chew on this for a while. Perhaps some new tools, ehancements, advanced CAD fun can come from it. Not everything is here, but it is a nice head start.