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


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 :: 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 :: 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 :: 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 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 :: Check If Layer Is In One Of Multiple Lists

Jul 18, 2013

I am trying to write a piece of a program that gets the layers from a drawing, and checks each one against a list of layers. If the layer is not a member of any of the lists it asks the user which layer list to add it to. This is what I have so far, but every time I try to run it I get a bad argument error.

(setq layerspresent (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))))(setq i 0) (repeat (vla-get-count layerspresent)(setq thislayer (vla-get-name (vla-item layerspresent i)))(cond(((progn(or(= nil (member thislayer 0list))(= nil (member thislayer detaillist))(= nil (member thislayer clearancelist))(= nil (member thislayer clearanceelist))(= nil (member thislayer doorsdrawerslist))(= nil (member thislayer hiddenlist))(= nil (member thislayer hiddenelist))(= nil (member thislayer deletelist)))));ifs((progn(initget "0 DEtail CLearance CLEarance-e DOOrs-and-Drawers HIdden HIddEn-E DELete")(setq userchoice (getkword "

[code]...

 Depending on the user's choice the layer gets written to an external file where the layer lists get their layers from in the beginning and then adds the layer to the relevant list to use later in the program.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Redefining Multiple Blocks Within Drawing

Mar 23, 2003

I have a lisp routine that uploads all the blocks contained within a specific folder and inserts or redefines all blocks of the same name within the current drawing.

My problem is that when I run the routine I prompts me that it can't fine the folder? I created a folder called "blocks" and is located straight onto my C:..........but it still doesn't work.

;FUNCTION TO UPDATE ALL BLOCKS WITHIN A DRAWING
;FROM A SPECIFIC DIRECTORY

(defun c:bup()
(SETVAR "cmdecho" 0)
(setq sst (ssget "X" (list (cons 0 "INSERT"))))
(setq c1 0)
[code].......

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create Layouts In Multiple Drawings

Aug 10, 2013

I have a csv file that has the drawing names and their layout names listed in columns A and B. Before I begin a project, I have to create the Sheet List (in Excel) and the csv file. The csv file is needed because I have a lisp routine that reads the csv and updates all my Title Block attributes in all my drawings. (VERY sweet program)  What I'm wanting to do, is create new layouts (using my dwt) based on the information in the csv file. So, when I start a new project all I need to do is create the base drawing files first. Then, in my csv file I've got those drawing names listed in Column A and their corresponding sheet titles (Layout names) in Column B. I run the lisp and it reads the csv and creates layouts in all those base drawings and naming the layouts with the sheet titles from column B.

Column A                                                      Column B
DRAWINGS                                                 SHEET TITLES
drawing1.dwg                                               A100
drawing1.dwg                                               A101
drawing"n".dwg                                            "n"500
Etc, etc.

I'm needing a way to automate creating hundreds of layouts at once. (very time consuming).So the lisp has to be able to read a csv (or Excel--doesn't really matter) and create new layouts (using my dwt) in as many drawing files represented in column A. [and filtered so it doesn't create duplicates so I can run the routine at a later date when new sheets are added to the drawings] Captcha?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Applying Layer State To Multiple DWGs

Jul 31, 2012

A quick way to apply a Layer State to multiple DWGS?

View 4 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 :: How To Create Macros Of A Drawing

Aug 6, 2012

How to create macros of a drawing and then hw can we change the drawing by editing the macro. E.g.. I have drawn a circle of 30 mm dia.. than need to crate macros for same and then by changing the dia of circle in macros I want to create new circle of 50 mm dia.

Another thing I wanted to ask is what is difference between visual lisp and visual basic. Which is easier??

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Create Some Plines In A Drawing

Sep 10, 2013

I have to create some plines in a drawing from the inputs provided by the client. I prepared a lisp code for it. I have to use it to 1000 drawings. Every time I open the drawing and running the lisp command.

Is any lisp code to run in bulk open drawings with out entering command prompt.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Layer Name And Description As Text In The Drawing?

Nov 14, 2013

is it possible to make a LISP program whcih write down my layer name and description as text or Mtext in the drawing, so it will look like:

A_Wall architecture wall

A_Column architecture column

something like that.Each text, which is written in the drawing should have the same layer like the layer name.

the closest i can get is this code below, which write the layer as text, but what missing is: i want to add the description behind the layer name:

(defun c:layerlegend (/ osm ortho clayer celtype cecolor start-point line-length text-height *error*)
(defun *error* (msg)
(setvar "osmode" osm)
(setvar "orthomode" ortho)
(setvar "clayer" clayer)
(setvar "celtype" celtype)
(setvar "cecolor" cecolor)
(princ msg)
)

[code]...

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Freeze Layer Without Opening The Drawing

Apr 23, 2010

is there any way to freeze a layer without opening the drawing in lisp?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: File That Create Layout For Each Layer?

Apr 13, 2013

Lisp file that create a layout for each layer,I’m looking for a lisp file that creates layout for each layer instead of doing this manually.

Software: AutoCAD 2014, AutoCAD C3D, AutoCAD M3D, Revit
Windows 7 (Ultimate 64 bits),
Firefox 20.0,
Kaspersky 2013.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Create Layer Name In Attributes String Value

Oct 15, 2013

How i can filter attributes string value.

How i set the layer name is = attributes string value.

Example:

A attributes string value is R8 .all these string is set the layer name is same string value(R8).

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create / Insert Block In Drawing

Sep 26, 2013

take a look at this piece of my LISP-routine.

(command "_.block" pause pause ss "")

where:

ss  -  is a Selection set of some entities

In the rest of code, I don't change the values of initdia, or cmdecho, or whatever else  

I haven't sill understood them that well.The problem is the following:

When My routine executes this line, I am promted for:

1. block name - that's OK

2. insertion point - that's OK

3. then the block-command receives correctly the entities from ss-selection set - that's OK

4. then all the object dissapear! **Problem here**

The block is created... I can insert it in the drawing from the block-data base...

But is there a way to let this block stay in the drawing ? without disappearing?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Batch Update Layer State In All Viewports Across Multiple Files

Nov 8, 2013

I'm creating a drawing set that has over 100 sheets with varying amounts of viewports on each sheet (from one to four). Each sheet is its own file, so there is only one layout per file. For each section of the drawing set, the viewports will have the same layer state.

Is there were a way to update the layerstate of each viewport through a batch LISP routine? This would save me DAYS in opening each file, importing the layer state, and restoring it for each viewport. It seems straight forward, but I have no idea where to start with batch routines.

View 4 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 :: 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 :: Create Layer From Highlighting Words In Text Or Mtext?

Sep 23, 2011

I want to create a layer from selecting only some words from an mtext or text entitty.

Is it possible to highlight and select only part of the text from an mtext using a lisp routine ? similar to how Adobe Reader can select text.

View 7 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 :: Using TEXT Not MTEXT To Create Multiple Lines Of Text?

Oct 4, 2011

3rd party tool which didn't match our scaling needs the file is a fas so I have tried to reverse engineer the whole function using trial and error. The following code works perfect except we need multiple (x amount) lines of text I have at current the M txt function which mimics and is effective for today however we need all lines to be individual.

I’m playing round with a loop but how to achieve my need..He had a 3rd party tool which didn't match our scaling needs the file is a fas so I have tried to reverse engineer the whole function using trial and error.

The following code works perfect except we need multiple (x amount) lines of text I have at current the M txt function which mimics and is effective for today however we need all lines to be individual.
 
;Starting lisp program...(defun C:REDtext ();Creating Layers (if non existant)...(command "layer" "m" "TEKST-1.5mm" "lt" "continuous" "" "c" "1" "" "");Memorising previous layer...(setq MYOLDLAYER (getvar "clayer"));Setting requierd layer...(COMMAND "LAYER" "SET" "TEKST-1.5mm" "");Setting variable "MYHEIGHT" to "DIMSCALE" x 2...(setq myheight (* 2 (getvar "DIMSCALE" )));Requesting and storing usser defind point...(setq MYPOINT (getpoint "Start punt :")); Requesting and storing user defind text...(setq MYTEXT (getstring T "Nieuw tekst :"));Placing text...(command "text" MYPOINT MYHEIGHT "0" MYTEXT); Restoring previous layer...(setvar "clayer" MYOLDLAYER);Closing lisp program...)

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selection Set Filter

Apr 23, 2013

I'm putting together some quick function that I can send 2 arguments and get from it the total area of a given hatch on the given layer. I think everything is in order but I'm having trouble with the selection set filter:

(DEFUN GET-HATCH-AREA (HATCH LAYR / area sset) (COND((AND(ssget "X" '((0 . "HATCH") (2 . HATCH) (8 . LAYR))) (SETQ area 0) (VLAX-FOR H (SETQ sset (VLA-GET-ACTIVESELECTIONSET (VLA-GET-ACTIVEDOCUMENT (VLAX-GET-ACAD-OBJECT)))) (SETQ area (+ (VLA-GET-AREA h) area))) (ALERT(STRCAT "Total area = " (IF (OR (= (GETVAR "lunits") 3) (= (GETVAR "lunits") 4) ) (STRCAT (RTOS area 2) " sq. in. (" (RTOS (/ area 144) 2) " sq. ft.)") (RTOS area) ) ) ) (VLA-DELETE sset) ) ) ))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: SSGET With Additional Filter?

Jan 6, 2014

I've been twigging around with a selectionset, but no luck. I need to build a ss with several named blocks and a few dynamic blocks which get selected as anonymous. Unfortunately not all dynamic blocks should be selected and I can find no way of either filtering out a list of dynamic blocks to exclude nor any way to campare to a list of dynamic blocks that I want selected. Below is the best idea that I had but if I wrap it into a foreach with an exclusion list, I get an empty selection set returned. (I'm guessing that I need to trim the pairs each iteration and only return the matches instead.)

(SETQ blklst (LIST "Cleaner" "DRAIN" "Return" "Therapy""PoolLight" "Paraleveler" "Waterleveler" "Skimmer" "UMSLEEVE") blst "Cleaner, DRAIN, Return, Therapy,PoolLight,Paraleveler,Waterleveler,Skimmer,UMSLEEVE")(IF (AND (SETQ ss (SSGET "x" (LIST '(0 . "INSERT") (CONS 2 (STRCAT "`*U*" blst)) '(410 . "Model")))) (FOREACH i blklst (MAPCAR '(LAMBDA (x)(IF (NOT (EQ i (VLA-GET-EFFECTIVENAME (VLAX-ENAME->VLA-OBJECT (CADR x)))))(SSDEL (CADR x) ss) ) ) (SSNAMEX ss)) ) ) (WHILE (SETQ Ent (SSNAME ss 0)) (SETQ BlkName (CDR (ASSOC 2 (ENTGET Ent)))) (IF(SETQ tempList (ASSOC BlkName EndList)) (SETQ EndList (SUBST (CONS BlkName (1+ (CDR tempList))) tempList EndList))(SETQ EndList (CONS (CONS BlkName 1) EndList)) ) (SSDEL Ent ss) ))

 The other code is long and I'd rather not confuse things; if I do not try to filter out any Unames, then everything works great and fast. Once I add in the "foreach i blklst" the code breaks and I get:
 
; error: null interface pointer: #<VLA-OBJECT 0000000000000000>
 returned.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Filter For Specific Attribute Tag

Aug 30, 2011

How would one modify

(= (cdr (assoc 0 data)) "ATTRIB")

in order to filter for a certain attribute tag named MYTAG

I am working with a custom LISP routine which reports out to a CSV file, an attribute extraction file - but I need my routine to ONLY evaluate blocks which have the MYTAG attribute tag. Then, if it passes that first check, it evaluates another list of Tags within those blocks - a list of tags which I have specified elsewhere in the code.

I am trying to modify my existing code as little as possible, and I think that if I do it at the line (which I've pasted above) - that will "pre-qualify" my selection set....

ATTACHED LISP IS THE FILE I AM WORKING WITH --- THE ACTUAL LINE I WANT TO MODIFY IS AT:

"(while (eq ENSUB "ATTRIB")"

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Filter If SSGet Is Empty

Jan 23, 2013

I wonder if I have to check if the "ssget" is empty.

I have a lisp to zoom extents in visible objects on the screen.

My interest is to filter before applying:If I have selected objects, it zooms in these objects. If I'm not have selected objects, continue as it is today, applying a zoom in the visible scene.

The result would be similar to a zoom of "3dsmax" (press the Z key)

The atual code

(defun c:ZOBJECTS(/ selectprev)(SETQ selectprev (SSGET "_P"))(command "._UCS" "View")(command "._zoom" "extents")(command ".__zoom" "object" "cross" "-1e99,-1e99" "1e99,1e99" "")(command "._UCS" "previous")(command "._select" selectprev ""))

View 6 Replies View Related

AutoCAD Civil 3D :: Create A Layer Filter That Excludes Both Civil Layers And Xrefs

May 3, 2012

I want to create a Layer Filter that excludes both Civil Layers and Xrefs.

I have created one that excludes Civil objects (Excel Civil.jpg)  but when I add a filter for excluding xrefs as well the Civil objects appear in the filter again indeed all the layers are included again (Excel Xref.jpg) if I invert the filter nothing is displayed. 

View 4 Replies View Related







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