Jump to content

Lisp that will: Take all enteties and move them to Layer 0


Recommended Posts

Posted

We currently export DXF files from Pro/ENGINEER to a Burn Table that has it's own custom software. The Burn Table is setup to read only Layer 0.

 

Is there a way we can export a DXF file from Pro/ENGINEER. Open it with our AutoCAD and run a Lisp Routine that will automatically move all lines, text and dimensions to Layer 0?

 

We don't need the current layers deleted, we simply want everything in Layer 0.

 

The Burn Table software is difficult to work with and we do this on a daily basis.

 

Thanks for any input you can provide.

 

-Proximo

Posted

This should do:

(defun c:allo (/ ss)
 (if (setq ss (ssget "X" (list (cons 0 "LINE,TEXT,MTEXT,DIMENSION")
                         (if (getvar "CTAB")
                             (cons 410 (getvar "CTAB"))
                             (cons 67 (- 1 (getvar "TILEMODE")))))))
   (command "_CHPROP" ss "" "LA" "0" "")
   (princ "\n<!> No Entities Found <!>"))
 (princ))

Posted

The above will move all:

 

Lines (not polylines)

Dimensions

M-text

D-text

 

to layer 0. - let me know if you need it modified to include other entities.

Posted

Lee,

 

Thank you very much. I will see how this works for us. I am thankful that guys like you are out there. This is all foreign to me.

 

I know Windows Batch Scripting and currently learning Java, but Lisp I have no clue about.

 

Thanks again.

Posted

however there is no facility to run LISP on a LT version of AutoCAD.

 

I can't remember back to 2002 but can you select everything then click on the layer table drop down on layer 0? This will work on AC2008.

Posted

I just realized that Lisp do not run on LT versions of Autocad.

 

We run version 2002 LT.

 

I will try the method to see what happens. I am sure it will work. I was hoping to have a Lisp that will do this and then maybe further automated it to run batches of drawings/dxf's that need to have everything moved over to Layer 0.

 

Autocad LT does support script files (*.scr), but I am not familiar with this at all.

 

Thanks again for all the help.

Posted

Ahh, sorry about that Proximo - didn't notice that you were running LT...

 

I'll see about a script for ya :P

Posted

Ok, a script is going to be difficult/impossible for this kind of situation - as, telling it to select certain objects is somewhat difficult.

 

I'd say your best option is to use QSELECT (Express... not sure if LT has express???). And select you various entities like that.

 

Either that, or upgrade :P

Posted

You should be able to change all of the main entities to 0 via a custom menu.

 

[CHPROP - ALL To 0]^c^c^p_.LAYER;_Thaw;*;_On;*;_Unlock;*;_Set;0;;_.CHPROP;_All;;_LAyer;0;;^p

It would not change entities nested in INSERTs. -David

Posted

And there is also script

 

_.LAyer
_Thaw
*
_On
*
_Unlock
*
_Set
0

_.CHPROP
_All

_LAyer
0

-David

CGALL2.SCR

Posted

I initially thought he wanted only lines, text and dimensions - but if he wants all, then yes, that is good.

  • 1 month later...
Posted

This macro will allow you to move any object to layer zero by selecting the object. When run, Layer 0 color is changed to WHITE (can be changed to any other color too) and then it waits for user to select the object to move to layer 0.

 

^C^C-layer;s;0;color;WHITE;0;;select si \chprop;p;;la;0;;

Posted

What's wrong with ctrl + a to select all entities in a drawing, then change it to layer 0 in the properties palette? Scripting seems like overkill.

Posted

I wrote that Macro because I only wanted a select amount of objects moved to layer 0, not everything. I thought it may help.

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