Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
angiegauthier
Posts: 55
Registered: ‎11-08-2010
Message 1 of 11 (501 Views)

Parametric drawing or dynamic block?

501 Views, 10 Replies
12-19-2012 11:03 AM

Hi Everyone,

 

I need some ideas with how to go about a project. We currently have a bunch of Lisp programs to create drawings but I am interested in exploring how I can maybe use Lisp with either dynamic blocks or parametric drawings. I just don't know which would make more sense. Currently we have programs where we enter things like width, height, leg or radius, bars wide and high etc and it creates a drawing like the one I've attached. I know that if I can create this drawing as a dynamic block or a parametric drawing, then when there are revisions, I don't need to create the drawing again. I can just adjust the parameter or the dynamic block. Can anyone give me an idea on what makes the most sense, a dynamic block or a parametric drawing? I should note that I'd still like to use autolisp to create the initial drawing (or insert the block) since that's what the users are used to.

Let me know your thoughts or ideas.

 

Thanks

Angie

Valued Contributor
Rtogores
Posts: 84
Registered: ‎02-07-2001
Message 2 of 11 (488 Views)

Re: Parametric drawing or dynamic block?

12-19-2012 01:48 PM in reply to: angiegauthier

A parametric drawing can be created easily calling commnds from AutoLISP. And the great thing is that you can call AutoLISP from within the Block Editor, this way creating a Block that exposes the dimensional constraints as parameters. I include a tutorial about this in my new book "AutoCAD expert's Visual LISP"

Regards,

 

Valued Contributor
angiegauthier
Posts: 55
Registered: ‎11-08-2010
Message 3 of 11 (483 Views)

Re: Parametric drawing or dynamic block?

12-19-2012 01:58 PM in reply to: Rtogores

so are you suggesting I use a mixture of parametric contstraints and dynamic blocks? Or are you saying either one would work? I already have an autolisp program that creates the drawing I've shown, but once it's created, it's a static drawing.

So it's easy to use Autolisp to create a parametric drawing? Becuase I have started to create a parametric drawing manually, and although it's not hard, it's taking a lot of time to constrain it properly.

Valued Contributor
Rtogores
Posts: 84
Registered: ‎02-07-2001
Message 4 of 11 (474 Views)

Re: Parametric drawing or dynamic block?

12-19-2012 04:04 PM in reply to: angiegauthier

This surface is an example of what I mean. It exposes several custom properties that can be modified.

Under the Properties palette you can change the radius of the different sections.

All has been created through AutoLISP.

 

Valued Contributor
Rtogores
Posts: 84
Registered: ‎02-07-2001
Message 5 of 11 (461 Views)

Re: Parametric drawing or dynamic block?

12-20-2012 04:43 AM in reply to: Rtogores

I am attaching an excerpt from my book's Chapter 20 which I hope can help you.

Valued Contributor
angiegauthier
Posts: 55
Registered: ‎11-08-2010
Message 6 of 11 (441 Views)

Re: Parametric drawing or dynamic block?

12-20-2012 08:17 AM in reply to: angiegauthier

would you happen to have a 2d example? Sorry, I don't work with 3D in autocad and I think it's the 3D stuff that's confusing me.

 

Angie

Valued Contributor
Rtogores
Posts: 84
Registered: ‎02-07-2001
Message 7 of 11 (424 Views)

Re: Parametric drawing or dynamic block?

12-21-2012 01:15 AM in reply to: angiegauthier

Try this:

Open block editor

Draw a rectangle

Apply geometric constraints with _Autoconstrain

Apply a dimensional constraint with _bcparameter _Linear _Object to the lower horizontal side

Close the block editor saving changes

Insert the block

Use properties to change the value of the d1 property.

 

Hope this helps,

Regards

Valued Contributor
angiegauthier
Posts: 55
Registered: ‎11-08-2010
Message 8 of 11 (398 Views)

Re: Parametric drawing or dynamic block?

12-27-2012 02:14 PM in reply to: angiegauthier

Makes sense. Thanks.

Now my question is: What is the difference between a  horizontal constraint parameter, or a linear parameter? (if that makes sense) and which is easier to create and/or modify using autolisp?

Valued Contributor
Rtogores
Posts: 84
Registered: ‎02-07-2001
Message 9 of 11 (388 Views)

Re: Parametric drawing or dynamic block?

12-28-2012 02:54 AM in reply to: angiegauthier

Just as in normal dimensions, Linear can be both horizontal or vertical, depending on the point you select to place the dimension.

Horizontal is always that, the same for Vertical.

So I prefer them to Linear, as I can be sure of what I get, without depending on the point used for placing the constraint.

Valued Contributor
angiegauthier
Posts: 55
Registered: ‎11-08-2010
Message 10 of 11 (376 Views)

Re: Parametric drawing or dynamic block?

12-28-2012 06:15 AM in reply to: angiegauthier

Is that the only difference? In the block editor, why does linear show up in the parameters tab of the block authoring palette, and the horizontal, vertical, etc show up on the constraints tab? That makes me think they do something different. (This may be an obvious question, but we have recently upgraded from Autocad 2008, so I've got some catching up to do)

 

Angie

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community