AutoCAD Visual LISP / AutoLISP :: Select Objects With Given Xdata?
Jan 2, 2012
with a function like this I added some xdata, some MULTILEADER
(defun c:add_xdata () (princ "Select: ") (setq ogg (car (entsel))) (addXdata ogg "TEST" "CODICE" "1256") (addXdata ogg "TEST" "MATERIALE" "LEGNO") (addXdata ogg "TEST" "TIPO" "A"))
Now with the following function can only select leaders who have linked the xdata application TEST
(setq selez_all (ssget "X" '((0 . "MULTILEADER")(-3 ("TEST")))))
I can not, however, find a way to select all MULTILEADER who have a particular value of XData.
For example I would select all MULTILEADER with MATERIALE = "LEGNO" and TIPO = "A".
View 4 Replies
ADVERTISEMENT
Jun 20, 2012
is it possible select all ANNOTATIVE objects in a DWG and to set a Viewport/ANNO scale for all via lisp
View 3 Replies
View Related
May 4, 2013
I want to make it so that I can keep selecting several objects and get all the starting points and endpoints of each one with (setq ent (entsel))
(Defun c:demo (/ ent)
(setq ent (entsel))
(princ)
)
View 9 Replies
View Related
Sep 5, 2013
I am trying to select multiple objects and change them. However, the following code lets me only change one at a time. Even when I select a window around obejcts, it only changes a single item.
start of Same_Cannoscale.lsp(defun C:SCS ( / anno-v ent dict cansc entsc sc-list test oce)
(setq anno-v (getvar "ANNOALLVISIBLE")) (setvar "ANNOALLVISIBLE" 1) (if (= (getvar "CVPORT") 1) (princ "
In Paperspace. ") (if (setq ent (ssget ":S:L"))
[Code] ........
View 5 Replies
View Related
Mar 29, 2012
How can i build a selection set of all circles and then retrieve the xdata attached to them?
View 9 Replies
View Related
Oct 14, 2013
Lisp code to read xdata information?
View 9 Replies
View Related
Aug 14, 2012
I have a drawing that i know has xdata attached to layer zero. the problem is, it's not an object i can find. Any routine to remove xdata from ALL objects. like a global remove xdata?
View 6 Replies
View Related
Oct 11, 2013
I have a problem in using a LISP program to use a tool from a third party software. We use a third party software in AutoCAD to draw objects on AutoCAD drawing (HVAC duct work). Because the objects are stored in the drawing in the format that only the third party software can understand, we rely on using the tools from the third party software to operate on their objects. That third party software is designed for many customers, and we are just one of their customer. Therefore, we cannot expect the third party software to have everything that we want. We want to develop a LISP program to automate our process to meet our specific needs. That LISP program will need to use the tools from the third party software in order to operate on their objects. And that is where the problem starts.
We have a piece of duct that has a duct body and a piece number tag. I have the entity handle of the duct body in our database. And I can use it to select the duct body using plain LISP program. But I don't know a way to select the piece number tag that is corresponding to the duct body. I have examined the properties of the duct using (entget (car (entsel))). But I cannot find an obvious way to link from the duct body to the piece number tag. This means I have to use a selection-tool from the third party software to select the piece number tag of the duct that I have selected using LISP. Unfortunately, I find that the third party selection-tool doesn't seem to work if I call it right in the middle of a LISP program. On the other hand, it works if I use it manually (outside LISP) or if it is used right before the LISP program is terminated. I don't understand why it doesn't work in the middle of a LISP program. I asked the developer of the third party software, and he said that this could not be done without rewriting the entire software.
By the way, I call that third party selectin-tool by either manually clicking at a button or using a C# program to simulate a mouse click at the button. Either way, the result is the same.
View 5 Replies
View Related
May 18, 2010
I need a Reactor to Modify Xdata - Length - contained in Line Object if this Line is modified (stretched, breaked, trimmed, etc).The routine need to verify if Line contain Xdata and modify it (and works with multiple selection).
I tried for long hours, but without success. I tried to create a list of entities while the reactor is applied, but doing so need another reactor to change these entities after the first Reactor works.The codes I used are below:
{code}
;If it just 1 string only you want to add
(defun add_xdata_str (e a v);;;EName APPID String_value
(and (not (tblsearch "APPID" a))
(regapp a))
(and (= (type e) 'ENAME)
[code]....
View 6 Replies
View Related
Sep 26, 2013
I have the below code, which works great accept if the layout tab doesn't have a viewport.What am I missing?
(defun ViewportLayerUpdate ()
(setq OLDcmdecho (getvar "cmdecho"))(setvar "cmdecho" 0)(setq OLDnomutt (getvar "nomutt"))(setvar "nomutt" 1)
(if (setq ss1 (ssget "X" (list (cons 0 "VIEWPORT"))))(if (setq ss (ssget "x" '((0 . "VIEWPORT") (-4 . "/=") (69 . 1))))
(command "CHPROP" ss1 "" "LA" "0-VPRT" "") ))
(if (setq ss1 (ssget "X" (list (cons 0 "VIEWPORT"))))(if (setq ss (ssget "x" '((0 . "VIEWPORT") (-4 . "/=") (69 . 1))))
(command "change" "p" "" "p" "color" "bylayer" "") ))
[code]...
Factory Design Suite Ultimate 2012
AutoCAD 2012 | Inventor Professional 2012 | Vault Professional 2012
View 3 Replies
View Related
Jun 19, 2013
Trying to add this macro to a new command in my cui. Does Select all not work in macros?
^C^Clayiso;;_select;all;;_chprop;la;c-rway-x;;
View 8 Replies
View Related
Feb 11, 2013
Newbie here trying to learn LISP. My first program is to flip all arcs and circles that have a Normal Z property of -1. But I'm having trouble finding a detailed list of commands and functions for the LISP language that explain creating circles to selecting entities filtered by properties. I must be searching for the wrong terminology.
View 9 Replies
View Related
Apr 10, 2012
I have the following code, that for some reason the last created dimension is no being selected. That's the first problem. The second (and not as improtant) problem( becasue it does work), is that I'm using the "dimedit" command. I prefer to do a swap within the dxf codes, that I treid but didn't work, so I resorted to the "dimedit" command.
(command "DIMLINEAR" pause pause pause)
(setq last_dim (entsel (entlast)))
(setq oldunits (getvar "lunits")) (setq oldprec (getvar "luprec"))
[Code].....
View 4 Replies
View Related
Jun 21, 2013
using autolisp or visual lisp I want to open "Select Color Dialog Box" URL....and get RGB color code to my lisp.If I enter "color" in command line, i get color dialog box, but if I use this command in (command "color") I get more promts and not color Dialog Box.
I want to make a lisp routine which would ask for first color, second color and range of colors. And will calculate color range from first color to second color.
View 7 Replies
View Related
Mar 11, 2005
I want to explode all anonymous blocks, but how do I create a selection set of them.?(ssget "x" '((2 . "*U*"))) doesn't work, and is dangerous if you have any blocks with the letter 'u' in them.
View 9 Replies
View Related
May 22, 2012
There is a very complecated drawing. Texts are on a line and crossing a line or something like that. Some texts has insertion points on the line. When the line is selected by LISP, only the specific texts with insertion points on the line are selected. Does it make sence?
View 8 Replies
View Related
Aug 28, 2011
I am interested in a program that can select layers by its color, and then change those layers to a different color and add a prefix of Z- in front of those layers.
Example:
Layer Names: Layer Color: New Layer Names: New Layer Color:
Wall 2 Z-Wall 100
Berm 2 Z-Berm 100
Fence 2 Z-Fence 100
I found a program (below) that works pretty close to what I am looking for but not quite.
;;; Change the color of a layer to another color by Jeff Mishler July 9, 2003
;;; Usage - (lay_col_chg oldcolor newcolor
;;; example: Command: (lay_col_chg 142 100)
[code]...
View 7 Replies
View Related
Feb 6, 2012
what I'm trying to do is have the program select the block and then I want to get out of it what the Block Name is, so I can then compare it to the list of block names that I want the program to move. Here is what I was trying to use:
(setq enlist2 (ssget "_X" (list '(0 . "INSERT") (cons 10 (trans '(0 0 0) 1 0)))))(setq en (entget enlist2))
However, when I do this, I get this error message: Error: bad argument type: lentityp <Selection set: 1e02>
If needed: AutoCAD 2013 User using Visual LISP for editing LISP and DCL files
Also I have AutoCAD 2011 currently still available for us, but we are using AutoCAD 2013 for 99.9% of AutoCAD use
View 4 Replies
View Related
Feb 12, 2013
Can I select a line and get the nearest endpoint so I can do something to the line using the endpoint as a base?
It will include an ssget and an osnap "end" in the code, but not too sure how to put it together.
View 3 Replies
View Related
Jun 17, 2012
I need to wright a routine in autolisp that selects all 3Dpolylines with the same vertex Z value.Qselect as no transparent mode and filter doesn't work.
View 7 Replies
View Related
Jul 30, 2013
When you select similar using autocad it select similar in entire drawing. What i want is i am able to select similar using the same setting of selecting similar but with window selection instead of entire drawing ?
View 6 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
Dec 16, 2013
I would like to select blocks based on the layer of one or more attributes. The obvious method would be to isolate that layer and select the ones with attributes that display. But many of the values are empty!
View 9 Replies
View Related
Feb 3, 2012
I'm having an issue with using the SSGET to select a block so I can move it. I'm changing the UCS to be at the center of the top view in the program(user selects center) and the block is at 0,0,0 after changing the UCS. However when I use SSGET it doesn't select it. So I used:
(setq en(car (entsel "
Select a block :")))(setq enlist(entget en))
and it lists the DXF Code of 10 as
(10 15.0893 13.5165 0.0)
How can I then select it if I don't necessarily know where the block is going to be?
If needed: AutoCAD 2013 User using Visual LISP for editing LISP and DCL files Also I have AutoCAD 2011 currently still available for us, but we are using AutoCAD 2013 for 99.9% of AutoCAD use
View 2 Replies
View Related
Aug 5, 2013
I would like to select a polyline that will either be straight or contain bulges and offset lines either side of it a prescribed amount, I have tried a couple of options that don't involve picking points on both sides to no avail.
View 4 Replies
View Related
Jun 29, 2012
Yesterday I post the message "Exporting pline and text" which turned out to work realy well.
However I need something else...
I need to select several plines and export their vertexes (as it is already done) BUT I also need to select SEVERAL texts and export them as well as their insertion point coordinates.
I tried with the code below but without any success... It gives the error "; error: ActiveX Server returned the error: unknown name: "TEXT"" This happens after selecting some texts and hiting enter.
Here is the
(defun c:zi5 ( / f i o s ss obj objdata texto texto_f nomebase nome_zi tx1 iPt)(vl-load-com)(setq nomebase (getstring "
Enter name for file:"))
(setq nome_zi (strcat "D:" nomebase "_zi.txt"))
(princ "Select your plines...")
(if (and (setq s (ssget '((0 . "LWPOLYLINE")))) (setq f (open nome_zi "w")) )
[Code]...
View 5 Replies
View Related
May 6, 2012
How can i select/highlight all items in a Multi_select list_box?
View 4 Replies
View Related
Sep 23, 2011
i am trying to select a dynamic block by its name but it does not work
(setq WW (ssget "x" (list (cons 2 "WET WELL"))))
View 8 Replies
View Related
Sep 13, 2011
I need a command that will allow the user to select a layout tab. I thought the following would work, but it just ends the LISP program:
(command "layout" "s" pause)
View 9 Replies
View Related
Dec 2, 2013
I need to make all the obj like one pol after I select them all not just the last one so I can get the intersection of each obj1
(DEFUN C:CHF ()
(vl-load-com)
(if (not (member "geomcal.arx" (arx)))
(arxload "geomcal")
)
(command "undo" "BE")
(setq osm (getvar "osmode"))
(setvar "osmode" 0)
[code]....
View 5 Replies
View Related
Nov 23, 2011
How I can select all layers using the command line?
I am going to write a piece of lisp which will reset all the lineweights for all layers to default and have started by doing it manually on the command line to see what I need to automate.
To start with I choose -layer then LW then type default and it is here I have a problem. It asks enter name list of layers for lineweight default which is where I need to choose all.
View 3 Replies
View Related