Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Parametric drawing or dynamic block?

10 REPLIES 10
Reply
Message 1 of 11
angiegauthier
1059 Views, 10 Replies

Parametric drawing or dynamic block?

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

10 REPLIES 10
Message 2 of 11
Rtogores
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,

 

Message 3 of 11
angiegauthier
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.

Message 4 of 11
Rtogores
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.

 

Message 5 of 11
Rtogores
in reply to: Rtogores

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

Message 6 of 11

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

Message 7 of 11
Rtogores
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

Message 8 of 11

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?

Message 9 of 11
Rtogores
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.

Message 10 of 11

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

Message 11 of 11
Rtogores
in reply to: angiegauthier

Dimensional constraints are implemented using normal dimensions. In fact Linear, Horizontal and Vertical are the same object type as you can see by typing in the console, after drawing them:

_$ (setq LinearDimConstraint (vlax-ename->vla-object (car (entsel))))
#<VLA-OBJECT IAcadDimRotated 000000003131fe18>

_$ (setq VerticalDimConstraint (vlax-ename->vla-object (car (entsel))))
#<VLA-OBJECT IAcadDimRotated 000000003131ffd8>

 

For some hints on parametric design you can see the Parametric Design post in my website.

 

Happy New Year!

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost