Lisps for a repetitive tasks

Lisps for a repetitive tasks

sam_safinia
Advocate Advocate
443 Views
2 Replies
Message 1 of 3

Lisps for a repetitive tasks

sam_safinia
Advocate
Advocate

Hi there,

 

I have been given a task which I made a routine to do few repetitive(call it boring!) functions to clean-up bunch of drawings. The only remaining tasks which I could not make a proper routine are:

 

1- My drawings have a layout tab"G" with an old title block and atts.(the old title block will delete during cleanup process). Now my working drawing has got just few atts and a viewport.

Also I am using  a drawing as a layout template (title block) source to use it in my drawings in c:\temp\TB.dwg. What i want to do is:

 

  a- Rename tab "G" to "Layout1"==> Done that

  b- Import/insert tilteblock form drawing TB.dwg into temp tab name:TEMP_LAYOUT ==> Done that

  c- Now copy content of TEMP_LAYOUT with base point of (0,0) into tab "Layout1" in point (0,0)

  d- Delete tab TEMP_LAYOUT and prompt to "Save as" dialogue window.   

  (b, c and d can be done in a single process)

 

....

(command "-layout" "TEMP_LAYOUT" "c:\temp\TB.dwg") 

......

 

2- How can I change font of all text styles into "txt.shx" which they have common string of "ABB" within their names. I've done it by a routine which I need to copy it with different scenarios but I don't want miss any. Is there any possibility of using *ABB* or similar

(command ".style" "ZABBZ" "txt" ....

(command ".style" "XABBY" "txt" ....

 

3- Similar to number 2, is that possible to collect all annotative text style within text Style list and change their fonts to "txt"?

xc.PNG

 

Thanks guys 🙂

0 Likes
444 Views
2 Replies
Replies (2)
Message 2 of 3

jdiala
Advocate
Advocate

@s_plant wrote:

 

2- How can I change font of all text styles into "txt.shx" which they have common string of "ABB" within their names. I've done it by a routine which I need to copy it with different scenarios but I don't want miss any. Is there any possibility of using *ABB* or similar

(command ".style" "ZABBZ" "txt" ....

(command ".style" "XABBY" "txt" ....

 

(vlax-map-collection (vla-get-textstyles (vla-get-activedocument (vlax-get-acad-object)))
  (function (lambda (x) 
      (if 
        (wcmatch (strcase (vla-get-name x)) "*ABB*")  
        (vla-put-fontfile x "TXT.SHX")
      )))
)

 

3- Similar to number 2, is that possible to collect all annotative text style within text Style list and change their fonts to "txt"?

 

  Try here http://forums.augi.com/showthread.php?73695-Current-Text-Style-Annotative

 

Message 3 of 3

sam_safinia
Advocate
Advocate

Many Thanks

0 Likes