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
ADVERTISEMENT
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
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
Nov 21, 2011
I want to set all the layers on all nested xref's to color 8.
View 9 Replies
View Related
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
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
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
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
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
Aug 27, 2013
Project involves repeatedly mirroring a line by selecting mutiple lines to do the mirroring. Probably sounds confusing.
The progress so far can be found here: [URL] ........
View 1 Replies
View Related
Jan 11, 2013
The below adds a hyperlink to the selected object.How might it have to change to add multiple hyperlinks?
(entmod
(append (entget (car (entsel)))
(list
(list -3
(cons "PE_URL"
(list
(cons 1000 "..\..\90 Submittals\90-3 O&Ms\fig83-clevishanger.pdf") ; Relative Path to a pdf file.
(cons 1002 "{")
[code]...
View 3 Replies
View Related
Feb 7, 2013
Is there a way or a lisp to scale multiple 3d polylines, at same time, and the base point is the start point of each one?
View 4 Replies
View Related
Nov 2, 2011
How to modify this routine so that I can select multiple objects as opposed to one at a time?
(Defun c:cd ()
(setq newdim (entsel "
Select Dimension to clear:"))
(setq newdimvalue " ")
(command "dimedit" "n" newdimvalue newdim "")
(princ)
)
View 9 Replies
View Related
Nov 3, 2008
I have a lisp I use to calculate the area of an object. The section below is the area part of it:
(setq ojt (entsel "Select object to get area of... "))
(command "area" "o" ojt)
(setq oarea (getvar "area"))
I want to modify it to add the areas of multiple objects. Unfortunately it is not as simple as;
(setq ojt (ssget "Select object to get area of... "))
(command "area" "a" "o" ojt)
(setq oarea (getvar "area"))
So how would I go about doing it?
View 7 Replies
View Related
Sep 9, 2011
Lisp (or a native way) to lengthen multiple polylines or lines at once to the same length by entering that length? I found the following lisp routine which extends a line an entered amount, but it has to be on a specific layer, and I want to enter the finished length, not how much to extend it.
(defun c:blen (/ lSet tmp doMode objLst actDoc)
;; *lDel global variable remembered during session
(or *lDel (setq *lDel 2.0)) ; default value
(princ "
>>> Select lines to extend/reduce <<< ")
(if (setq lSet
[code].........
View 3 Replies
View Related
Jul 5, 2012
i am wondering if it is possible to alter a specific attribute in cca 250 files? I have this template which has like 50-70 attributes,but not all of them are used. I have to change only one attribute in all of the files. For instance, i have an attribute with a specisfic tag, but the content of it is ie MARK, i want to change MARK to PETER, without having to open,click,retype,save,close every file. Is it possible to automatize it somehow? maybe lisp, batch or even VB?
View 2 Replies
View Related
Aug 3, 2013
I want to join multiple lines together like join command but with multi selection.
View 6 Replies
View Related
Dec 17, 2013
I'm using a Lisp which searches a certain folder and then updates all blocks, which are nested in that folder.
My issue is, that I'd like to use more than one folder on different path, where the LISP can search for this files. Is there a way to use multiple search path?
The code I'm using now to search for the blocks is: (setq dir "I:\AutoCAD Blöcke\Template\Support")
View 9 Replies
View Related
Apr 25, 2013
I need to divide thousands of lines into half, but AutoCAD divide command can only allow you to select one line at a time.Is there any way we can divide multiple lines at once.
View 9 Replies
View Related
Feb 7, 2012
I have a lisp routine that gathers all xrefs from the current drawing and creates a script that opens each xref, runs specific commands then saves/closes each drawing. Once all commands have been ran in each xref I would like the script to reload all xrefs in the original drawing that the script was called from. I have a reload-all lisp that is already loaded in all of my drawings but for some reason when this command is called at the end of the script it will not run.
Is there a way to have the script continue to run in the original drawing that it was called from? Or maybe even pass control back to the lisp that created/called the script? Its seems to me that the easiest thing would be to have the script continue to run after it has gone through all of the specified drawings but this is not working.
View 9 Replies
View Related
Sep 8, 2013
How can Attach multiple images into autocad .? at a time ..!!
Any lisp available ?
View 5 Replies
View Related
Oct 7, 2013
For example :
command is beginning with choices
1- choose number ... ( 10 / 20 / 30 ) :
2- choose color ... ( red / blue / cyan ) :
after choices if 1.st choice is 10 and 2.nd one is red , then run to AAA command
after choices if 1.st choice is 20 and 2.nd one is blue , then run to BBB command
after choices if 1.st choice is 30 and 2.nd one is cyan , then run to CCC command
simply like that..
View 3 Replies
View Related
Nov 27, 2012
I'm currently working on a project that requires that I eTransmit a large quantity of files, which is becoming very time consuming. I need writing a script that will allow me to etransmit all of the files at once.
My requirements:
- All .dwgs must be saved as individual .zip files with all references included.
- .zip file must have same name as associated .dwg (basically just swap extensions).
My progress:
- Seems very simple, basically my script is:
Qsave
-eTransmit
-CH
-SetupName
-C
ROADBLOCK!!!!!!! D:<
My problem is that I want to have AutoCAD return the filename sans extension and filepath when I'm prompted to input the filename for the .zip file. How can I do this? I've been looking up options using VBA, but with limited success given.
View 1 Replies
View Related
Mar 21, 2013
This time I'm wrestling with getting the values from multiple blocks. The blocks all have the same name but at least the attributes have names this time. Each block have exactly 4 attributes, like: att1 (a number representing chronological order), att2 (some data), att3 (the actual date as a string of when the data was added), att4 (some more data)
I need to get and store the attribute's values. I was hoping to make a selectionset of the blocks and step through using the chronological order number.
At this point I have tried several combinations of foreach and ssget "x" (list (cons 2 MYBLOCK)), but I keep getting errors that I'm sure are telling me that I'm not passing the correct information to the function for iterating through. I'm banging my head.
(DEFUN c:GFOR (/ ATTLST REVBLK CNT CNT1 BLK RBLK ATTVAL ATT REV#)
(SETQATTLST(LIST "R#" "INIT" "DATE" "DESC")REVBLK(ssget "x" (list (cons 0 "INSERT") (cons 2 "REVISION")))CNT0CNT10 )
(vlax-ldata-put "dict" "RevTotal" (BLKCNT "REVISIONS")) (FOREACH BLK REVBLK (SETQ RBLK (ssname BLK CNT1)) (setq ATTVAL (mapcar '(lambda (x) (vla-get-TextString x)) (vlax-invoke (vlax-ename->vla-object RBLK) 'GetAttributes))) (foreach ATT ATTLST (SETQ REV# (STRCAT "REVISION" (1+ CNT)))
(vlax-ldata-put "dict" REV# (member ATTVAL)) (setq CNT (1+ CNT)) ) (SETQ CNT1 (1+ CNT1)) ) (PRINC))
View 9 Replies
View Related
Jun 11, 2007
I ment midpoint instead of center.Is it possible to select several different line entities and have them each rotated around its midpoint, or end point, so afterwards all have the same direction specified by a number or specified by direction of another entity?I wish command matchprop had that rotation option in its Settings.
View 9 Replies
View Related
Sep 13, 2012
Is it possible to loop through multiple files in a directory?
Like this: (setq file (open "..\TOPO QUADS\*.jgw" "r"))
Windows 7 x 64 Professional
Nvidia Quadro 4000
8 GB Ram
i5 2500 @ 3.30 GHz
Civil 3D 2012 SP 2
Civil 3D 2013 SP 1
View 9 Replies
View Related
May 31, 2012
I have some general knowledge in lisp coding. But I can't seem to figure this one out (even to get started). What I want to do is make a lisp that:
- selects a line
then
- select any amount of text (any type)
then
- moves all the text to that selected line without rotating the text
if a line is perfectly horizontal then move the text of the y axis.
if the line is vertical then move the text of the x axis.
or there can be a prompt asking the user to chose the angle or axis in which the text will move (say if they want to move the text to a slanted line, you can choose to move the text on an angle, while keeping the same format and not rotating the text, or you can ask the user if they want to move it only vertically or horizontally)
I would really like the code to integrate into my autocad.
See pictures
View 5 Replies
View Related
Aug 8, 2012
I know how to retrieve the entity information from the block, but can't figure out how to write the loop statement to loop, look for first attribute, assign to a variable, goto next attribute, assign to different variable, etc., etc...
In my research, most programs I've seen it execute the loop, assign to a variable, then print/put that data somewhere, loop again and utilize the same variable to print/put the next data somewhere.
I would like each attribute within a block to be assigned a separate variable.
View 7 Replies
View Related
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
Nov 11, 2011
Lisp program, by selecting on screen multiple block attribute and to change those selected (by picking) attributes to colour 252.
At the moment, I'm using a custom macro : ^C^C-ATTEDIT C;252;;
But if I've got a lot of attributes to change, it takes awhile to complete.
I know about BATTMAN but I do not want to change the block entities in that way. The reason I want to change the attributes to colour 252 is because here at this company we do existing drawing in colour 252 and any new equipment on its proper layer colours.
View 1 Replies
View Related
Nov 6, 2012
Any lisp routine on how to change "Drawing Properties" (fields via Mtext) on multiple single drawing files?
There are several instances where we would need to take a project to create another one and simply change the title block description.
As of now, we are opening each drawing (there could be hundreds) and modifiying the drawing properties on each drawing to change the customer name and other project descriptions.
These are not attributes, but fields. I've researched alot on here and couldnt find anything.
The drawing is attached.
View 3 Replies
View Related