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

Title Block Fields and attributes Pushing info into them

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
375 Views, 3 Replies

Title Block Fields and attributes Pushing info into them

I have seen many pieces of code here, but can't get any of them to work.  I am looking to do this with autolsip.

So here's what i need.

I have 2 things to do.

1. update the dwgprops with the log in name.

2. update a border block file with the scale.  The scale is coming from a variable "scaletxt".  The block is the name of the paper size (asize, bsize, csize, etc....). The attribute name is "Scale". 

 

If i can make a single routine and call the 2 differnt pieces that will keep my code smaller.  I have tried the following, but was not able to pass the variables thru.

Program:

(defun c:update(a1 a2 a3/ EN EG SS KK)
 (setq Block_Name a1)
 (setq Attrib_Name a2)
 (setq Attrib_Value a3)
 (if (setq SS (ssget "X" (list (cons 0 "INSERT") (cons 2 Block_Name))))
 (progn
  (setq KK 0)
  (while (< KK (sslength SS))
   (setq EG (entget (ssname SS KK)))
   (setq EN (entget (entnext (cdr (assoc -1 EG)))))
   (while (and EN (/= (cdr (assoc 0 EN)) "SEQEND"))
    (if (= (strcase (cdr (assoc 2 EN))) Attrib_Name)
    (progn
    (setq EN (subst (cons 1 Attrib_Value) (assoc 1 EN) EN))
    (entmod EN)
 (entupd (cdr (assoc -1 EG)))
  )
  )
 (setq EN (entget (entnext (cdr (assoc -1 EN)))))
  )
 (setq KK (1+ KK))
 )
 )
 )
)

 

Sending the info

(update blockname attribute value)

 

Any help will be appreciated.

jselzer

3 REPLIES 3
Message 2 of 4
pbejse
in reply to: Anonymous

What is dwgprops?
   An attribute Tag on your Titlblock?
   or the summary info drawing properties?

Is there more than one instances of the border block on the same drawing?
More than 1 layout tab per drawing?
Border block on modelsapce or at layout tab?

Depending on your answer, The variable "scaletxt" represents all scale on all border blocks?

 

You want this done via selection or programmatically?
Attribute name "scale" is always on the same order for every papersize block?
   i.e... third Tag for asize?
          third tag for bsize?
   knowing this ahead of time will not needlesly run thru all of the tagnames
 

Message 3 of 4
Anonymous
in reply to: pbejse

Sorry for the missing information.

 

-Summary information in the Drawing Properties is where i want to push the loginname.  Author will be the same for all the borders in a file. So if i change the borders to pull the information from a field, all i need to do is get Lisp to push the loginname to the field "Author"

 

-yes, more than 1 instance of the same border in a file, also possibly different scales for the same border type (ie 1 bsize border at full scale & 1 at half scale).  I need to display the scale of each border to help size dim text correctly (sizing dimtext between borders will be my next challenge, if they were all teh same scale it would be easy).

 

-Model space only at this time.

 

- right now programmatically, using a lisp to insert them.  I have the lisp written to insert them and it is working fine.  I am now tweaking it to include this automatically fill in the scale and Author fields.

 

- the tag is in the same place for all 4 borders (A-D sizes).

 

Message 4 of 4
Anonymous
in reply to: Anonymous

Ok, I finally found part of what i need.

Pushing the Author to the Field command:

 

 (vl-load-com)
 (setq acadObj (vlax-get-acad-object))
 (setq acDoc (vlax-get-property acadObj 'ActiveDocument))
 (setq acDocSumInfo (vlax-get-property acDoc 'SummaryInfo))
 (setq name (getvar "LOGINNAME"))
 (vlax-put-property acDocSumInfo 'Author name)

 

No i need to finish the scaletext.

 

 

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

Post to forums  

Autodesk Design & Make Report

”Boost