AutoCAD Visual LISP / AutoLISP :: Make All Object You Select Into One With Foreach

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


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Math In Foreach Function

May 15, 2013

In the foreach function can you use math like (foreach pt1 (add 1) so that foreach one you pick it adds one the next one will be named pt2 then pt3 and so on.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select All Viewports (LSP)?

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

AutoCAD Visual LISP / AutoLISP :: Select All In Macro

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

AutoCAD Visual LISP / AutoLISP :: Possible To Pull Out Coordinates From Object When Object Snap Applied?

Aug 29, 2011

I have a rather simple 3rd party custom object... I tried to get its bounding box but the coordinates that come back don't seem to relate at all to the object.

What I'd like are the coordinates of two nodes the object contains...

Is it possible to apply the autocad cursor in some why with the node object snap to get their coordinates?

View 4 Replies View Related

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 View Related

AutoCAD Visual LISP / AutoLISP :: Select Arcs By With Normal Z -1

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

AutoCAD Visual LISP / AutoLISP :: Select Last Created Dimension?

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

AutoCAD Visual LISP / AutoLISP :: Possible Select All ANNOTATIVE Objects In A DWG

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

AutoCAD Visual LISP / AutoLISP :: Select Color Dialog Box

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

AutoCAD Visual LISP / AutoLISP :: Select All Anonymous Blocks

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

AutoCAD Visual LISP / AutoLISP :: Select Texts On A Line?

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

AutoCAD Visual LISP / AutoLISP :: Select Layer By Color

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

AutoCAD Visual LISP / AutoLISP :: Unable To Select A Block

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

AutoCAD Visual LISP / AutoLISP :: Select Line And Get Endpoint?

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

AutoCAD Visual LISP / AutoLISP :: Select All 3D Polylines With Same Vertex Z Values

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

AutoCAD Visual LISP / AutoLISP :: Select Similar By Window Selection

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

AutoCAD Visual LISP / AutoLISP :: Multiple Select Attribute Colour?

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

AutoCAD Visual LISP / AutoLISP :: Select Several Objects And Get Starting / Endpoint Of Each One

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

AutoCAD Visual LISP / AutoLISP :: Select Blocks By Attribute Layer

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

AutoCAD Visual LISP / AutoLISP :: Using SSGET To Select A Block To Move It

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

AutoCAD Visual LISP / AutoLISP :: Select A Polyline That Will Either Be Straight Or Contain Bulge

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

AutoCAD Visual LISP / AutoLISP :: How To Select Several Plines And Export Their Vertexes

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

AutoCAD Visual LISP / AutoLISP :: Select / Highlight All Items In List Box?

May 6, 2012

How can i select/highlight all items in a Multi_select list_box? 

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select Dynamic Block By Its Name But It Does Not Work?

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

AutoCAD Visual LISP / AutoLISP :: Pause To Allow User To Select Layout Tab

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

AutoCAD Visual LISP / AutoLISP :: How To Select All Layers Using Command Line

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

AutoCAD Visual LISP / AutoLISP :: Select Multiple Objects And Change Them?

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

AutoCAD Visual LISP / AutoLISP :: Select All Viewports In Drawing / Get Name Of Layout

Sep 29, 2013

I need to select all the viewports in the drawing and to make some changes with them, I'm planning to select them all with ssget command. If I do that I will have one viewport for the paperspace itself in every layout. One of my question is, how to know which viewport is the paperspace itself?

Second question is, how to get the name of layout in which one is the viewport? It is important to me that the lisp is really fast, so I'm planning to do the most of stuffs with vla commands.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Radio Cluster To Select Next Dialog Box

Feb 20, 2012

I'm trying to set up a main dialog box with three radio buttons.  the selected button will determine which 'next' dialog box appears when the next button is clicked.  
 
(defun c:steel (/ dcl_id) (setq dcl_id (load_dialog "steel.dcl")) (if (not (new_dialog "steel" dcl_id)) (exit) ) (action_tile "angle" "(setq shape "angle")") (action_tile "beam" "(setq shape "beam")") (action_tile "channel" "(setq shape "channel")") (action_tile "accept" (cond ((= shape "angle")(c:angle)) ((= shape "beam")(c:beam)) ((= shape "channel")(c:channel)) ) ) (start_dialog) (unload_dialog dcl_id) (princ))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: User Is Prompted To Select A Row Of Blocks?

Oct 25, 2011

I am looking for a way where a user is prompted to select a row of blocks and then that row is completely mirrored about the middle of the selection set - such that if the blocks are originally inserted, from left to right "A" "B" C"  then after mirroring, we want them t occupy (roughly) the same space in the drawing area as "C" "B" "A".

Then, immediately after mirroring that selection set in place, each individual block that makes up the selection set is mirrored about its insertion point along the x axis..... basically i need to mirror a selection set of a row of blocks so I change their order of occurrence and then mirror each individual block back again to the way it is meant to look.

Is this possible?

View 9 Replies View Related







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