Jump to content

Splitting up drawing into seperate files with LISP function?


Recommended Posts

Posted

Hi! I am kind of new to the whole LISP thing and I was wondering if someone could possibly help me in a task I am trying to complete.

 

I have several diagram "sheets" (100+) that all have the same size title block and are all located on one drawing file (all in Model Space). Each "sheet" is spaced evenly apart in several rows and colums. When I design what I have to design -it's easier to keep all the sheets on one drawings so I can make mods to several sheets quickly. When I have to submit the final design, I have to split up the drawing and name each of the sheets the file the name in that sheets title block

 

Is there anyway I can acheive this using a LISP pgm?

 

If so, any pointers?

  • Replies 116
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    59

  • KLKSMILE

    53

  • Biscuits

    3

  • ronjonp

    2

Posted

If everything was kept within the border, you could make a LISP that would take each border in turn (getting it by its block name), and create a selection set of it and everything inside it (using the bounding box coords of the border), then you could wblock each selection set.

 

Just my thoughts. :)

 

Lee

Posted

So would each sheet or border need to have a seperate block name?

Do you or anybody have any similar LISP that I could possible use as an example?

 

If everything was kept within the border, you could make a LISP that would take each border in turn (getting it by its block name), and create a selection set of it and everything inside it (using the bounding box coords of the border), then you could wblock each selection set.

Posted

The borders can have all the same name or separate names, it would make no difference.

 

I don't currently have a LISP that does this at the moment, but if you give me the name of the border block, I could knock one up for you :D

Posted

Well I guess just call it "border" - currently there is no name / the borders are just made up of single lines - but I can create a block called border.

Posted

No probs - I shall indicate where the name of the block goes in the LISP, so you can alter it as necessary.

Posted

Give this a shot:

 

[i][color=#990099];; Drawing Cutter, by Lee McDonnell 24.04.2009[/color][/i]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:DwgCut [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] file path ss miPt maPt iSs fname[b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]vl-load-com[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] doc [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveDocument[/color][/b]
             [b][color=RED]([/color][/b][b][color=BLUE]vlax-get-acad-object[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
       file [b][color=RED]([/color][/b][b][color=BLUE]getfiled[/color][/b] [b][color=#ff00ff]"Select Location for New Files"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] $def $def [b][color=#ff00ff]""[/color][/b][b][color=RED])[/color][/b] [b][color=#ff00ff]"dwg"[/color][/b] [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]not[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] $def file[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]exit[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] path [b][color=RED]([/color][/b][b][color=BLUE]vl-filename-directory[/color][/b] file[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] ss [b][color=RED]([/color][/b][b][color=BLUE]ssget[/color][/b] [b][color=#ff00ff]"X"[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=RED]([/color][/b][b][color=#009900]0[/color][/b] . [b][color=#ff00ff]"INSERT"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]2[/color][/b] . [b][color=#ff00ff]"BORDER"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]foreach[/color][/b] Obj [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]vlax-ename->vla-object[/color][/b]
                        [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]cadr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]ssnamex[/color][/b] ss[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vla-getBoundingBox[/color][/b] Obj [b][color=DARKRED]'[/color][/b]miPt [b][color=DARKRED]'[/color][/b]maPt[b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] winLst [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]function[/color][/b]
               [b][color=RED]([/color][/b][b][color=BLUE]lambda[/color][/b] [b][color=RED]([/color][/b]x[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-safearray->list[/color][/b] x[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]list[/color][/b] miPt maPt[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
           iSs [b][color=RED]([/color][/b][b][color=BLUE]ssget[/color][/b] [b][color=#ff00ff]"_C"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] winLst[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cadr[/color][/b] winLst[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
           fname [b][color=RED]([/color][/b][b][color=BLUE]vl-filename-mktemp[/color][/b] [b][color=#ff00ff]"Dwg~"[/color][/b] path [b][color=#ff00ff]".dwg"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vla-wBlock[/color][/b] doc fname [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveSelectionSet[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n<!> No Borders Found <!>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

 

The above will work on all blocks called "border".

 

The files written are prefixed Dwg~

Posted

Wow - thank you so much!!!!

 

That program totally worked to split up all the files.

 

So now :) the other thing I need to do is properly name each file. The title of each sheet is located in the title block at the bottom corner of each sheet. If I make the title a separate layer or ? block, could the LISP name each sheet according to the title w-in each border? If not, then I'm thinking you could open each sheet individually after the split and somehow grab the name in the title block and then replace the temp file name? If you could help - I would really appreciate it again!

 

 

Thank you again!

Posted

The best way to do it would be to have the drawing title as an attribute on the title block. :thumbsup:

Posted

So I would have to make a separate block and title it's attribute for each sheet? Is there any other way I could pull the name? Even if it's already been separated? The issue is that the file name often changes when new sheets are added and such.

Posted

This code would work if it was an attribute:

 

[i][color=#990099];; Drawing Cutter, by Lee McDonnell 24.04.2009[/color][/i]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:DwgCut [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] file path ss miPt maPt iSs i Nme fname[b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]vl-load-com[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] doc [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveDocument[/color][/b]
             [b][color=RED]([/color][/b][b][color=BLUE]vlax-get-acad-object[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
       file [b][color=RED]([/color][/b][b][color=BLUE]getfiled[/color][/b] [b][color=#ff00ff]"Select Location for New Files"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] $def $def [b][color=#ff00ff]""[/color][/b][b][color=RED])[/color][/b] [b][color=#ff00ff]"dwg"[/color][/b] [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]  
 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]not[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] $def file[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]exit[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] path [b][color=RED]([/color][/b][b][color=BLUE]vl-filename-directory[/color][/b] file[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] ss [b][color=RED]([/color][/b][b][color=BLUE]ssget[/color][/b] [b][color=#ff00ff]"X"[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=RED]([/color][/b][b][color=#009900]0[/color][/b] . [b][color=#ff00ff]"INSERT"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]2[/color][/b] . [b][color=#ff00ff]"BORDER"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]66[/color][/b] . [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]foreach[/color][/b] Obj [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]vlax-ename->vla-object[/color][/b]
                        [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]cadr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]ssnamex[/color][/b] ss[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vla-getBoundingBox[/color][/b] Obj [b][color=DARKRED]'[/color][/b]miPt [b][color=DARKRED]'[/color][/b]maPt[b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] winLst [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]function[/color][/b]
               [b][color=RED]([/color][/b][b][color=BLUE]lambda[/color][/b] [b][color=RED]([/color][/b]x[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-safearray->list[/color][/b] x[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]list[/color][/b] miPt maPt[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
           iSs [b][color=RED]([/color][/b][b][color=BLUE]ssget[/color][/b] [b][color=#ff00ff]"_C"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] winLst[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cadr[/color][/b] winLst[b][color=RED])[/color][/b][b][color=RED])[/color][/b] i [b][color=#009900]2[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]foreach[/color][/b] att [b][color=RED]([/color][/b][b][color=BLUE]vlax-safearray->list[/color][/b]
                     [b][color=RED]([/color][/b][b][color=BLUE]vlax-variant-value[/color][/b]
                       [b][color=RED]([/color][/b][b][color=BLUE]vla-GetAttributes[/color][/b] Obj[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]eq[/color][/b] [b][color=#ff00ff]"NAME"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-TagString[/color][/b] att[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] Nme [b][color=RED]([/color][/b][b][color=BLUE]vla-get-TextString[/color][/b] att[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]member[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] Nme [b][color=#ff00ff]".dwg"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vl-directory-files[/color][/b] path [b][color=#ff00ff]"*.dwg"[/color][/b] [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]progn[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] Nme [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] Nme [b][color=RED]([/color][/b][b][color=BLUE]chr[/color][/b] [b][color=#009900]40[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]itoa[/color][/b] i[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]chr[/color][/b] [b][color=#009900]41[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] i [b][color=RED]([/color][/b][b][color=BLUE]1+[/color][/b] i[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]while[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]member[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] Nme [b][color=#ff00ff]".dwg"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vl-directory-files[/color][/b] path [b][color=#ff00ff]"*.dwg"[/color][/b] [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
           [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] Nme [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b]
                       [b][color=RED]([/color][/b][b][color=BLUE]substr[/color][/b] Nme [b][color=#009900]1[/color][/b]
                         [b][color=RED]([/color][/b][b][color=BLUE]-[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]strlen[/color][/b] Nme[b][color=RED])[/color][/b] [b][color=#009900]3[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]chr[/color][/b] [b][color=#009900]40[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]itoa[/color][/b] i[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]chr[/color][/b] [b][color=#009900]41[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] i [b][color=RED]([/color][/b][b][color=BLUE]1+[/color][/b] i[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] fname [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] path [b][color=#ff00ff]"\\"[/color][/b] Nme [b][color=#ff00ff]".dwg"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vla-wBlock[/color][/b] doc fname [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveSelectionSet[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n<!> No Borders Found <!>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

If you are not going with this way, we need some defining factor that would separate the dwg name from all the other text in the drawing - like maybe being on its own layer.

 

If you were going to go with the attribute idea, you would have to copy the title block and input the drawing name into the attribute for each sheet.

 

The above code is slightly longer than it needs to be, as I have incorporated the case in which you may have several duplicate drawing names. The above code assumes an attribute tag name of "NAME" but this can be altered if necessary.

Posted

If you were to go with TEXT in the drawing frame, make sure that the Title text is all on its own layer, and you can use this:

 

[i][color=#990099];; Drawing Cutter V3, by Lee McDonnell 27.04.2009[/color][/i]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:DwgCut [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] file path ss miPt maPt iSs i Nme fname[b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]vl-load-com[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] doc [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveDocument[/color][/b]
             [b][color=RED]([/color][/b][b][color=BLUE]vlax-get-acad-object[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
       file [b][color=RED]([/color][/b][b][color=BLUE]getfiled[/color][/b] [b][color=#ff00ff]"Select Location for New Files"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] $def $def [b][color=#ff00ff]""[/color][/b][b][color=RED])[/color][/b] [b][color=#ff00ff]"dwg"[/color][/b] [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]  
 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]not[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] $def file[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]exit[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] path [b][color=RED]([/color][/b][b][color=BLUE]vl-filename-directory[/color][/b] file[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] ss [b][color=RED]([/color][/b][b][color=BLUE]ssget[/color][/b] [b][color=#ff00ff]"X"[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=RED]([/color][/b][b][color=#009900]0[/color][/b] . [b][color=#ff00ff]"INSERT"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]2[/color][/b] . [b][color=#ff00ff]"BORDER"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]foreach[/color][/b] Obj [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]vlax-ename->vla-object[/color][/b]
                        [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]cadr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]ssnamex[/color][/b] ss[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vla-getBoundingBox[/color][/b] Obj [b][color=DARKRED]'[/color][/b]miPt [b][color=DARKRED]'[/color][/b]maPt[b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] winLst [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]function[/color][/b]
               [b][color=RED]([/color][/b][b][color=BLUE]lambda[/color][/b] [b][color=RED]([/color][/b]x[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-safearray->list[/color][/b] x[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]list[/color][/b] miPt maPt[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
           iSs [b][color=RED]([/color][/b][b][color=BLUE]ssget[/color][/b] [b][color=#ff00ff]"_C"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] winLst[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cadr[/color][/b] winLst[b][color=RED])[/color][/b][b][color=RED])[/color][/b] i [b][color=#009900]2[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]foreach[/color][/b] ent [b][color=RED]([/color][/b][b][color=BLUE]vl-remove-if[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]listp[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]cadr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]ssnamex[/color][/b] iSs[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]eq[/color][/b] [b][color=#ff00ff]"TitleText"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cdr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]8[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] ent[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] Nme [b][color=RED]([/color][/b][b][color=BLUE]cdr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]1[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] ent[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]member[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] Nme [b][color=#ff00ff]".dwg"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vl-directory-files[/color][/b] path [b][color=#ff00ff]"*.dwg"[/color][/b] [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]progn[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] Nme [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] Nme [b][color=RED]([/color][/b][b][color=BLUE]chr[/color][/b] [b][color=#009900]40[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]itoa[/color][/b] i[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]chr[/color][/b] [b][color=#009900]41[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] i [b][color=RED]([/color][/b][b][color=BLUE]1+[/color][/b] i[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]while[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]member[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] Nme [b][color=#ff00ff]".dwg"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vl-directory-files[/color][/b] path [b][color=#ff00ff]"*.dwg"[/color][/b] [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
           [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] Nme [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b]
                       [b][color=RED]([/color][/b][b][color=BLUE]substr[/color][/b] Nme [b][color=#009900]1[/color][/b]
                         [b][color=RED]([/color][/b][b][color=BLUE]-[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]strlen[/color][/b] Nme[b][color=RED])[/color][/b] [b][color=#009900]3[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]chr[/color][/b] [b][color=#009900]40[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]itoa[/color][/b] i[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]chr[/color][/b] [b][color=#009900]41[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] i [b][color=RED]([/color][/b][b][color=BLUE]1+[/color][/b] i[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] fname [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] path [b][color=#ff00ff]"\\"[/color][/b] Nme [b][color=#ff00ff]".dwg"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vla-wBlock[/color][/b] doc fname [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveSelectionSet[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n<!> No Borders Found <!>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

The name of the layer for the drawing name text I have called "TitleText" in the LISP, but this can be changed to whatever you like. :)

Posted

I don't think the attribute method would be the best route for my situation. I am constantly changing the names and I really don't want to have to input the title for each sheet. The package I am working on at the moment is only 100+ sheets but there are several that I have worked on that are 350+...That's a lot of inputting and a good opportunity for error.

 

I like the idea of putting the titles on a separate layer. I could do this very quickly and easily.

 

BTW you are so AWESOME! Thank you so much!

Posted

I like the idea of putting the titles on a separate layer. I could do this very quickly and easily.

 

As in my previous post, this layer is set to "TitleText" but let me know if you want this changed :)

 

 

BTW you are so AWESOME! Thank you so much!

 

Thanks :D

Posted

Actually, this is slightly better - it allows for other entities on the title text layer that may affect the naming:

 

[i][color=#990099];; Drawing Cutter V3, by Lee McDonnell 27.04.2009[/color][/i]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:DwgCut [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] file path ss miPt maPt iSs i Nme fname[b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]vl-load-com[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] doc [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveDocument[/color][/b]
             [b][color=RED]([/color][/b][b][color=BLUE]vlax-get-acad-object[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
       file [b][color=RED]([/color][/b][b][color=BLUE]getfiled[/color][/b] [b][color=#ff00ff]"Select Location for New Files"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] $def $def [b][color=#ff00ff]""[/color][/b][b][color=RED])[/color][/b] [b][color=#ff00ff]"dwg"[/color][/b] [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]  
 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]not[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] $def file[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]exit[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] path [b][color=RED]([/color][/b][b][color=BLUE]vl-filename-directory[/color][/b] file[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] ss [b][color=RED]([/color][/b][b][color=BLUE]ssget[/color][/b] [b][color=#ff00ff]"X"[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=RED]([/color][/b][b][color=#009900]0[/color][/b] . [b][color=#ff00ff]"INSERT"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]2[/color][/b] . [b][color=#ff00ff]"BORDER"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]foreach[/color][/b] Obj [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]vlax-ename->vla-object[/color][/b]
                        [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]cadr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]ssnamex[/color][/b] ss[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vla-getBoundingBox[/color][/b] Obj [b][color=DARKRED]'[/color][/b]miPt [b][color=DARKRED]'[/color][/b]maPt[b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] winLst [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]function[/color][/b]
               [b][color=RED]([/color][/b][b][color=BLUE]lambda[/color][/b] [b][color=RED]([/color][/b]x[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-safearray->list[/color][/b] x[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]list[/color][/b] miPt maPt[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
           iSs [b][color=RED]([/color][/b][b][color=BLUE]ssget[/color][/b] [b][color=#ff00ff]"_C"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] winLst[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cadr[/color][/b] winLst[b][color=RED])[/color][/b][b][color=RED])[/color][/b] i [b][color=#009900]2[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]foreach[/color][/b] ent [b][color=RED]([/color][/b][b][color=BLUE]vl-remove-if[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]listp[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]cadr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]ssnamex[/color][/b] iSs[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]eq[/color][/b] [b][color=#ff00ff]"TitleText"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cdr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]8[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] ent[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
                [b][color=RED]([/color][/b][b][color=BLUE]member[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cdr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]0[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] ent[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=#ff00ff]"TEXT"[/color][/b] [b][color=#ff00ff]"MTEXT"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] Nme [b][color=RED]([/color][/b][b][color=BLUE]cdr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]1[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] ent[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]member[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] Nme [b][color=#ff00ff]".dwg"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vl-directory-files[/color][/b] path [b][color=#ff00ff]"*.dwg"[/color][/b] [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]progn[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] Nme [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] Nme [b][color=RED]([/color][/b][b][color=BLUE]chr[/color][/b] [b][color=#009900]40[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]itoa[/color][/b] i[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]chr[/color][/b] [b][color=#009900]41[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] i [b][color=RED]([/color][/b][b][color=BLUE]1+[/color][/b] i[b][color=RED])[/color][/b][b][color=RED])[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]while[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]member[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] Nme [b][color=#ff00ff]".dwg"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vl-directory-files[/color][/b] path [b][color=#ff00ff]"*.dwg"[/color][/b] [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
           [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] Nme [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b]
                       [b][color=RED]([/color][/b][b][color=BLUE]substr[/color][/b] Nme [b][color=#009900]1[/color][/b]
                         [b][color=RED]([/color][/b][b][color=BLUE]-[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]strlen[/color][/b] Nme[b][color=RED])[/color][/b] [b][color=#009900]3[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]chr[/color][/b] [b][color=#009900]40[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]itoa[/color][/b] i[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]chr[/color][/b] [b][color=#009900]41[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] i [b][color=RED]([/color][/b][b][color=BLUE]1+[/color][/b] i[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] fname [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] path [b][color=#ff00ff]"\\"[/color][/b] Nme [b][color=#ff00ff]".dwg"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vla-wBlock[/color][/b] doc fname [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveSelectionSet[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n<!> No Borders Found <!>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

Posted

Just to help you out, heres a quick way to put all the text on the right layer:

 

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:lm [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] ent[b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]vl-load-com[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]or[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]tblsearch[/color][/b] [b][color=#ff00ff]"LAYER"[/color][/b] [b][color=#ff00ff]"TitleText"[/color][/b][b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]vla-add[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-layers[/color][/b]
                [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveDocument[/color][/b]
                  [b][color=RED]([/color][/b][b][color=BLUE]vlax-get-acad-object[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=#ff00ff]"TitleText"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]while[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] ent [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entsel[/color][/b] [b][color=#ff00ff]"\nSelect Title Text: "[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
             [b][color=RED]([/color][/b][b][color=BLUE]member[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cdr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]0[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] ent[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=#ff00ff]"TEXT"[/color][/b] [b][color=#ff00ff]"MTEXT"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
   [b][color=RED]([/color][/b][b][color=BLUE]vla-put-layer[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-ename->vla-object[/color][/b] ent[b][color=RED])[/color][/b] [b][color=#ff00ff]"TitleText"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]

Posted

So you are amazing! That totally worked!

Ok - I PROMISE THIS IS THE LAST QUESTION J

What I normally now have to do is run this TAG LISP that we use to tag each drawing with the date, initials, etc. The only problem is that the TAG LISP requires the bottom right corner of the BORDER to be at 0,0. Do you know how to insert the new drawings at the origin? Also, would it be possible to include the TAG LISP with the DwgCut LISP so I wouldn’t have to open each drawing individually? If not, no worries, what you just created will save me and so many of my co-workers soooo much time!

The Following is the TAG Lisp:

(defun c:TAG (/ CE AP CL DN CD MX HR MN LM LX DX TH DS MO YR TM TX)

(setq CE (getvar "CMDECHO"))

(setvar "CMDECHO" 0)

(setvar "limcheck" 0)

(setq AP "AM"

CL (getvar "CLAYER")

DN (getvar "DWGNAME")

CD (rtos (getvar "CDATE") 2 4)

MX (atoi (substr CD 5 2))

HR (atoi (substr CD 10 2))

MN (substr CD 12 2)

LM (getvar "LIMMIN")

LX (getvar "LIMMAX")

DX (distance LM LX)

TH (rtos (/ DX 200) 2 2)

DS (polar LM (/ pi 200) (/ DX -300))

MO (nth MX '(nil "JAN" "FEB" "MAR" "APR" "MAY" "JUN"

"JUL" "AUG" "SEP" "OCT" "NOV" "DEC"))

)

(if (>= HR 12) (setq AP "PM"))

(if (>= HR 13) (setq HR (itoa (- HR 12))) (setq HR (itoa HR)))

(setq YR (strcat "DATE: " MO " " (substr CD 7 2) ", " (substr CD 1 4)))

(setq TM (strcat "DRFT: KLK " "FILE:" DN " " YR " TIME: " HR ":" MN " " AP))

(command ".LAYER" "T" "DATESTAMP" "")

(command ".LAYER" "N" "DATESTAMP" "C" "2" "DATESTAMP" "S" "DATESTAMP" "")

(setq TX (ssget "X" (list (cons 8 "DATESTAMP"))))

(command ".ERASE" TX ""

; ".STYLE" "SIMPLEX" "" "0" "1" "0" "N" "N" "N"

".TEXT" DS TH "90" TM

".LAYER" "S" CL ""

)

(setvar "CMDECHO" CE)

(print)

(print TM)

(princ)

(command "zoom" "e")

)

Posted

I'm glad to have helped you out - I shall take a look at your Tagging LISP and see what I can do :)

Posted

Just a few questions -

 

Are all the borders the same size?

 

Could you upload a sample of the border with date stamp?

 

Cheers

 

Lee

Posted

Just a heads up....when using :

(ssget "_C" (car winLst) (cadr winLst)) i 2)

 

All the objects need to be visible on the screen or they will not be selected.

 

Maybe adding something like this to the loop:

 

(vla-zoomwindow (vlax-get-acad-object)

(vlax-3d-point (car winlst))

(vlax-3d-point (cadr winlst))

)

 

Ron

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...