Jump to content

Access and edit titleblock through autolisp? - EDIT: Need help with multi-variable lambda


Recommended Posts

Posted (edited)

Hello,

 

I'm trying to automate my titleblock to remove possibility of silly errors.  

 

The titleblock is edited through an enhanced attribute editor.  How would I go about accessing it through autolisp?

 

Thanks!

 

EDIT: Well, I should try more before I ask - you can access the data through vlax-invoke!  I'm leaving this up so others who are looking can find this useful.

 

Does anyone have a list of vlax-invoke values?  Right now I'm using 'getattributes but I'd like to see what is possible.  

 

I'm going to use this thread as a live update of my progress.  When I try using (apply 'vla-get-textstring attributes), I get a warning for having too many parameters!  What is the limit for apply, and is there a workaround?

 

Since I'm just using this for info, what do you pass into a multivariate lambda function?  i.e. (lambda (x y ) (x + y) lst) what would be lst?

 

  (setq todo (list  (list 0 "1") 
         	    (list 1  (strcat getMM "-" getDD "-" getYY)) 
           	    (list 2  name) 
           	    (list 3 "Initial Release.") 
         	    (list 33  name) 
         	    (list 34  name) 
         	    (list 35  sheetnum) 
          	    (list 24  projname)  
  )

  (mapcar '(lambda (no na) (vla-put-textstring (nth no atts) na)) (todo))

 

Is what I have now, but it doesn't work at all.

Edited by TemporaryCAD
Posted (edited)

Would this be any use?

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/td-p/6927162

 

 

If you want to set up several drawings you can also look at Lee Macs Batch Attribute Editor - hands with a border to put in client details in a series for example, not so good to out in individual details like a drawing title - but does what it does very well

Edited by Steven P
  • TemporaryCAD changed the title to Access and edit titleblock through autolisp? - EDIT: Need help with multi-variable lambda
Posted (edited)

For list 1

(menucmd "M=$(edtime, $(getvar,date),DD-MO-YYYY)")

 

Edited by mhupp

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...