.NET

Reply
Mentor
JamieVJohnson2
Posts: 167
Registered: ‎08-26-2010
Message 1 of 9 (1,298 Views)
Accepted Solution

Parametric Constraints

1298 Views, 8 Replies
12-06-2010 11:23 AM

Hello everybody,

 

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.

 

Thank you,

 

jvj

jvj

Hello,

I frequent this site:

http://through-the-interface.typepad.com/

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

HTH.-

Hello Community,

 

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.

 

jvj

*Expert Elite*
chiefbraincloud
Posts: 753
Registered: ‎02-13-2008
Message 2 of 9 (1,277 Views)

Re: Parametric Constraints

12-07-2010 12:22 PM in reply to: JamieVJohnson2

Hi Jamie,

 

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:

 

http://through-the-interface.typepad.com/through_the_interface/2009/03/accessing-the-properties-of-a...

 

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.

Dave O.                                                                  Sig-Logos32.png
Mentor
JamieVJohnson2
Posts: 167
Registered: ‎08-26-2010
Message 3 of 9 (1,253 Views)

Re: Parametric Constraints

12-08-2010 07:19 AM in reply to: JamieVJohnson2

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?

 

Thanks,

 

jvj

jvj
Active Contributor LE3
Active Contributor
LE3
Posts: 30
Registered: ‎06-07-2004
Message 4 of 9 (1,224 Views)

Re: Parametric Constraints

12-10-2010 07:51 AM in reply to: JamieVJohnson2

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.

Thanks!

Mentor
JamieVJohnson2
Posts: 167
Registered: ‎08-26-2010
Message 5 of 9 (1,212 Views)

Re: Parametric Constraints

12-10-2010 10:16 AM in reply to: JamieVJohnson2

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.

 

Thanks,

 

jvj

jvj
Mentor
JamieVJohnson2
Posts: 167
Registered: ‎08-26-2010
Message 6 of 9 (1,206 Views)

Re: Parametric Constraints

12-10-2010 10:31 AM in reply to: JamieVJohnson2

Sweet!

 

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.

 

Thanks,

 

jvj

jvj
Active Contributor LE3
Active Contributor
LE3
Posts: 30
Registered: ‎06-07-2004
Message 7 of 9 (1,167 Views)

Re: Parametric Constraints

12-11-2010 10:14 AM in reply to: JamieVJohnson2

Hello,

I frequent this site:

http://through-the-interface.typepad.com/

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

HTH.-

Mentor
JamieVJohnson2
Posts: 167
Registered: ‎08-26-2010
Message 8 of 9 (1,138 Views)

Re: Parametric Constraints

12-13-2010 10:15 AM in reply to: JamieVJohnson2

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!:robotvery-happy:

 

jvj

jvj
Mentor
JamieVJohnson2
Posts: 167
Registered: ‎08-26-2010
Message 9 of 9 (728 Views)

Re: Parametric Constraints

08-09-2011 02:27 PM in reply to: JamieVJohnson2

Hello Community,

 

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.

 

jvj

jvj
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.