Jump to content
deejaydave

Using a text file to add and manipulate Dynamic Blocks

Recommended Posts

BIGAL

What I am saying is run full code and if it errors then post all the commands so we can see error message.

 

 

Any else one out there tried it ? Its a smart dynamic block, we may have a use for something similar.

Share this post


Link to post
Share on other sites
deejaydave

I have attached a txt file with the whole list, from loading the lisp file onwards, I don't get any "error" messages.

 

 

Hope this is helpful.

 

 

Regards

deejaydave

DIP_BLOCK_LIST.txt

Share this post


Link to post
Share on other sites
deejaydave

I have managed to get it to work. I edited the 1st lot of code you sent, I deleted the following lines:

(setq fname (open "P:\\Autodesk\\lisp\\civilcad6layercodes.txt" "r"))

and

(foreach att (vlax-invoke obj 'getattributes)

(if (= "ANGLE" (strcase (vla-get-tagstring att)))

(vla-put-textstring att ang)

)

)

I then saved the file as a new name, ran it and it worked.

The original angle was the “Dip Direction”, which affects the rotation of the block, I have now been asked to add the “Dip Angle”, which has no effect on the block, it just adds a text box with the angle, my question is this “Would I be able to add this new element to the code, based on what is already there?”.

 

 

 

I would like to than you for all the help you have given me, I think I need to learn a little more about lisp.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×