AutoCAD Visual LISP / AutoLISP :: Moving XRefs To Another Layer

Oct 31, 2011

I have been looking around the web to find a quick lsp routine that will take all the xrefs in a drawings and move them back onto layer "xref" or "0" depending on what the design team wants.

The ones I have found don't work or move all the xrefs to separate layers.

View 9 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Create Layer By Xrefs And Blocks?

Nov 15, 2013

who can share with me a lisp which can create layer by xrefs and blocks ( if this can be an optional , would be nice ) ?

even maybe lisp can create layer group filter with "XREF" group name and move layers to inside.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Drawing With Multiple Xrefs - Create Local Layer Filter

Aug 13, 2013

I often work on drawings which have multiple xrefs, each having up to 100 Layers or more, so the layer manager can be a bit difficult to trawl through to find a local layer to select.

I know how to create a local layer filter using the code ~*|* from the new filter area in layer manager.

Ideally all I want to have to type in is: LOCAL and then the local layer filter would be created, with the filter name being Local-Layers (or similar).

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Moving Objects To Different Layer Is Slow

Nov 26, 2013

I find that the command to move objects to a different layers runs very slow in one of the drawing.  I want to find out what wrong with the drawing and how to speed things up.

I have a LISP program that batch processes a large number of drawings.  One of the step to process each drawing is to change the colors of some objects according to the status of the objects.  I do this by moving the objects to a later that has the right color.  So far the program only takes 2 to 4 minutes to process each drawing.  But the program takes close to 90 minutes to process one specific drawing.  I track down the problem has to do with the command that moves the objects to the right layer, like this:
 
(vl-cmdf "_.chprop" (ssget) "" "_layer" "ABC-Prod-Good-Pcs" "")

 This command takes a very long time to finish, like 40 minutes each time it runs (to move 1200+ objects), and the program needs to run it twice for a total of approximately 80 minutes.

Please note that the drawing itself is not the largest drawing, and it doesn't have the largest number of objects to be moved either.  It is close to the top-5 drawings in term of drawing size and the number of objects to be moved. I cannot say that the drawing size or the number of objects to be moved are the cause of the problem.

I tried to "speed up" by moving 200 objects incrementally.  That didn't work. I tried to "speed up" by moving 100 objects incrementally and saving the drawing after each 100 objects are moved.  That didn't work either; actually the speed is slightly slower than simply moving 1200+ objects all at once.

I don't know what to do.  I believe there may be something unusual about that drawing.  By the way, the reason why I choose to change color by moving objects to a different layer has to do with the fact that I have found this is the best way so far. I tried to change the color of the objects directly.  But I find that the color of some sub-parts of the objects are not changed (because their color is by-layer). That's why I choose to change color by moving objects to a different layer.

How I can check the drawing, any different way to change color that is better.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Nested Blocks In XREFS

Apr 21, 2008

I have an XREF that contain block inserts sometimes nested 2 or 3 levels deep. Given the block names, is it possible to find and translate the insertion point of the nested inserts to the current World UCS?

Ideally I would give a routine the block name and it would scan the current drawing and return a list of the translated insertionpoints>

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Multiple Ncopy From Xrefs

Oct 14, 2013

I have been using to copy multiple objects from x-refs. The problem I'm having is that when I have the user input prompts in a macro i can screw up the command if i accidentally miss picking my selection set. I'm new to LISP and having trouble with selection sets and selection filtering.

On another note: I'm trying to rename layers copied this way to remove the "$0$" and using the rename command swapping $0$* with * works, however in the -rename command it does not.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Color On All Nested Xrefs

Nov 21, 2011

I want to set all the layers on all nested xref's to color 8.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Renaming Relative Path Xrefs?

Oct 12, 2011

I have set up a master set of dwg. files we use to create our construction documents.  The files consist of a master file that xrefs base files.  All of our files are named using the project # first. (i.e. 2011001c.dwg).  I have set up the master set using x's to replace the numbers.

Here is how it works:

XXXXXXXc.dwg (master file) relative path xref's the following files.
XXXXXXXlw.dwg
XXXXXXXvlw.dwg
XXXXXXXeg
XXXXXXXfg
XXXXXXXtitleblock

note:  all of these files are saved in the same folder.

I am trying to find a way to keep the xref paths working when I copy the files to a project folder and rename the files using the actual job # insead of the x's as place holders.  As it is now, when I change the drawing name the reference is lost and I have to manually change all of the xref paths in the xref manager.  Is there a command, program, or lisp routine than can change the file names and update the paths automatically.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Collect Xrefs Inserted By XATTACH

Jul 3, 2013

I have a LISP that use the XATTCH command. How can I collect xrefs inserted by XATTACH? It can be more than one xref.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select And Bind All Xrefs In Model Space

Oct 9, 2012

Any code that will select all xrefs in modelspace and bind (insert) them?

the   -xref  bind command requires explicit names and if I use * it will also bind my titleblock xref in paperspace which I want to avoid.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Moving Objects In The X / Y Plane Only

Jul 29, 2013

I want to move a large 3D steel file on top of a 2D architectural background. The ISSUE is that when i move it (in plan view "aka top view") the X,Y coordinates change AND the Z coordinate changes... But, I want the Z coordinate to stay the same . I wrote a LISP file that doesnt seem to work (SEE BELOW):
 
(defun C:MoveXY (/ PT1 PTB PT2)(setvar "CMDECHO" 0)(setq PT1 (getpoint "
Specify Base Point or [Displacement] Displacement: ")PTB (getpoint "
Specify second point or <use first point as displacement>: ")PT2 (list (car PTB)(cadr PTB)(cddr PT1)))(command "_.MOVE" (SSGET) "" PT1 PT2))

It seems my issue comes when i get to the command line (ssget) seems to mess it all up . How to use the ".Move" command with the (ssget) function?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Moving Attribute Block With Tag String Name

Dec 20, 2013

I have a lot of attribute blocks in my drawing which i want to move them one by one

so , here is what i want to do :

I have numbers (or texts) in my work area and this numbers also exist in my attribute blocks .. i wanna move my attribute blocks with tag name value reference to my specify area if tag name values are matching with text or numbers in this area .. every block will check my selected tag string and will be move on matching text in my work area.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Moving Object From Layout To Another Programmatically

Dec 14, 2011

how to do this programmatically and without modifying the handle of the object,i am trying to do it programmatically (entmod (cons 410 newname)(assoc 410 ... no luck.

(entmakex -ing will modify or create a new handle ctrl-X and then ctrl-V recreates a new handle too ...

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Moving Objects Vertically In 3d View

Jan 1, 2014

I am having trouble moving an object a certain distance. The distance is defined by a pre-defined variable. I just can't figure out the syntax for the autolisp command.

Here is the bit of code if written, there is more code not shared here that defines the points for the polyline .

;-- the varaible box_height is defined earlier in the routine

;-- Draw the polyline for the top of the cabinet
(command "pline" p1tt P2tt P3tt P4tt P5tt P6tt P7tt P8tt "c")

;-- Assign the new part a variable name
(setq cab_toppl (entlast))

;-- Extrude the polyline to make the top of the cabinet
(command "extrude" cab_toppl "" cab_intw "0")

;-- Assign the new part a variable name
(setq cab_top (entlast))

;-- Rotate the top of the cabinet down to the floor of cabinet

(command "rotate3d" cab_top "" 2 p1tt p2tt 90)

;-- Move the top of the cabinet to the final location

;--  HERE IS THE PART I'M HAVING TROUBLE WITH.  ESSENTIALLY ONCE THE PART IS CREATED I'VE NAMED IT CAB_TOP AND AM NOW TRYING TO MOVE IT IN THE Z AXIS THE DISTANCE DEFINED BY THE VARIABLE BOX_HEIGHT WITHOUT USER INPUT

(command "move" cab_top "" "0,0,0" (list (0 0 (box_height) "") 

;--THIS PART IS OKAY

(setvar "CLAYER" oldlayer) ;restore active layer

(setvar "BLIPMODE" 1)
(setvar "OSMODE" 135)

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Script For Moving Drawing In Multiple Drawings?

Apr 23, 2013

QT : 1 . I  am looking for a script to move the drawing such that the left bottom corner is placed at 0,0  without any manual intervension. This is to done for all the files in a particular folder.

QT : 2   In the same script file I want one block to be inserted also in each drawing. the block is placed in the network drive . so how to copy the path after putting the insert command.  I tried -insert;  but it is not working how can i give the path in script file.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Prevent Certain Object In Layer Change To New Layer Automatic?

Apr 17, 2012

lisp..It work fine but just that i need some minor modificatio to it...At moment, when i activate the lisp, it will automatic select all dimension,leader and multileader to a layer call "DIMENSION"...Anyway i wonder if it is possible to prevent any dimension,leader or multileader in layer "Section" will not be change to layer "Dimension"?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Move Objects To New Layer Based On Their Present Layer

Jun 20, 2012

Say I have 2 items, one is on layer "M-Duct" and the other on "M-Pipe" (they are in the same drawing). Any lisp routine that would create the layers "M-Duct-New" and "M-Pipe-New" (based on the same color and LT as the original layers) and then move those objects to the newly created layers?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Link Xref Layer To Local Layer - Same Display

Feb 21, 2013

Possible to link an xref layer and local layer so they display the same (eg. sync viewport colour, linewieght, line type)?

I insert xref's for my base drawing but legend is on local layers and I would like to be able to ensure that the line colour and linetype always match...

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Leader On Layer And Still Remain On Original Layer

Aug 28, 2012

I have a customized button to draw an ‘ac-arrow’.  I created a lisp to create the layer “G-ANNO-LEDR”

if the layer name is not found.  The advanced part I would like is:

Current layer:  E-ANNO-WIRE

Ac-Arrow Leader:  G-ANNO-LEDR

OPTION 1:

If, say I am on current layer “E-ANNO-WIRE” and need to draw my “ac-arrow” leader, and continue working

on the original layer “E-ANN-WIRE”  (and have the leader  be drawn [remain] on the layer “G-ANNO-WIRE”).

With this option, I have the block “ac-arrow” imbedded in my template drawing file to have the block at hand.

With this option, the layer “G-ANNO-LEDR” will be created IF it is not on the drawing.

OPTION 2:

- Currently be on layer “E-ANNO-WIRE”

- Bring in the block “ac-arrow” from my block library “L:AutoCADSymbols”

- Draw the “ac-arrow” leader which will be on layer “G-ANNO-LEDR”   (this layer created IF it is not

  on the current drawing).

- After the leader is drawn’

- Be put back to the layer I was,  “E-ANNO-WIRE”, and continue working.

The OPTION 2 is what I would really like to have.  A while back, I happen to see one like OPTION 2, but I cannot

find it anymore on the users groups.  I have been searching for a while now.

Currently, I use the button in my customized toolbar (see image) and have to have the “ac-arrow” block in my drawing and have its layer created in the drawing.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change All Objects On Layer 0 To Existing Layer PC Module

May 31, 2012

I'd like to have/write a lisp to change all objects on layer "0" to layer "PC - Module"

If possible also;

save the document close the document open next in directory run layer changer program again.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Script That Assigns Lineweights To Layer Based On Color Of That Layer

Nov 19, 2013

Any script that when ran will set lineweights of a layer based on what color the layer is assigned.  For instance if I have 3 lines that are green on 3 different layers. I need the script to change all 3 layers lineweight   to .015mm. I have drawings that are inconsistant with layer names so layer translator and methods of that nature will not work because I do not know all the layer names and I have 100 drawings to do this to.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Getting Objects Layer?

Feb 7, 2010

How can I get the layer that an entity is on. I have tried numerous method but they don't seen to be retrieving the layer information.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Using Layer Translator?

Aug 29, 2013

I am trying to improve quality of exported drawings from Revit. We had troubles with lines and setting „by layer“. We found solution, but unfortunately we have to do it manually for each drawing.

how to program (by using LISP for instance) following commands?

Start Layer Translator (command „laytrans“)In Layer Translator, load the same drawing in section „Translate To“In Settings check only „force object colour to ByLayer“ and „Translate objects in blocks“Click on „map same“Click on „translate“Done

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selecting All On Layer 5

Mar 26, 2013

What a lisp routine would look like for selecting all items on layer 5. 

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Draw Line In A Layer

Jun 5, 2013

How do I select the layer in which I want to draw?

for example i draw two line and Each of them has to be in different layer.

How do I select the layer  which I want to draw?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change All Hatch To Particular Layer

Nov 7, 2013

Lisp that can select all hatch in a drawing with a layer called AELE, even if it is embedded in a block and change it to layer AHAT with Green colour?

The layer AHAT may or may not already exist in the drawing.

We need to run the lisp on a lot of drawings (exported from Revit) so I need to use the script to run this lisp on multiple drawings.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Autoselect Layer For Dimensions?

Jun 29, 2013

When selecting any dimension type (from the standard AutoCAD toolbars) i would like it to already be in the layer "dimensions". Currently it starts in layer 0. 

I've been browsing the web a bit and found a lot about it but people are talking about LISP's?? I can do magic things in AutoCAD but i am a complete stranger to LISP's, Macro's, etc... Would like to learn but where to start..

Anyway i can cover this with something else then writing an LISP?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Layer State Delete

Feb 20, 2013

i have a small lisp and i would like for it to:

when i invoke the plot command, it will first check if there is a layer state called "Temp"if "Temp" exists, then delete "Temp", then re-create "Temp", then switch layer state temporariliy to "Plot" to plot the file, and then switch back to the "Temp" layer state againbasically, the "Plot" layer state will be set based on how the drawing(s) will plot. if a user makes changes here-n-there in the drawing, when the user wants to plot, the software will save current state as "Temp", plot using the "Plot" state, and switch back to "Temp" state at the end. all i am trying to achieve is to somehow over-write the "Temp" state. below is the LISP.
 
(command "undefine" "plot")
(defun clot ()
(if (layerstate-has "Temp")
(layerstate-delete “Temp”)
)

[Code]....

Civil 3D 2013 SP1, Win 7-64 bit
12GB RAM

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Unreconciled Layer Filter

Jun 2, 2013

How to automate the unreconciled layer list to automatically freeze all the layers in the list when opening drawing.  This would force the user to select what layers they want shown rather than freezing / turning off the layers they don't want.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Block Layer

Jul 25, 2006

I have been filtering through this descuession group for a whil this morning looking for what I need and have found somethings that are close but haven't managed to change them a little to do what I am wanting..

I have drawings with a block named UG101 and has been inserted on all sort of different layers.

What I would like to do is run a lisp routine that would select all blocks with the name UG101 and put them on the layer CableInfo.

I have many other blocks that i need to do the same to but with different names, so I was hoping, I could change the lisp routine around to do the rest of the blocks in the drawing..

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Command / If Layer Is Frozen

Mar 29, 2012

I have a  Layer named "Arch - Niveau 1".I would like to enter in the command prompt  "a1"..It would read if the layer is frozen or thawed and if it is frozen, it will thaw it?

And if the layer is thawed, it would freeze it..What could be added is: To check up if the layer exists and if not, create it.Would do the same for 2 other layer named "Arch - Niveau 2" command "a2"   and  "Arch - Niveau 3" command "a3". Is it clear?Now the lisp I've found and modified is this:

(defun c:a1 (/ lay ldef flag) (setq layn "Arch - Niveau 1") (command "_.LAYER") (if (not (tblsearch "LAYER" layn)) (command "_Make" layn) (progn (setq ldef (tblsearch "LAYER" layn) flag (cdr (assoc 70 ldef))) (and (= (logand flag 1) 1) (command "_Thaw" layn)) )) (command ""))
 This lisp looks if it exists, if not, create it and only thaw the layer.

I'm not enough familiar with the "not", the "progn" the "flag", "and" and "logand"  (!!!!)

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved