AutoCAD Visual LISP / AutoLISP :: VLA Move With Selection Sets

Oct 3, 2011

I wrote a lisp program which creates a selection set using ssget. Then I use the bounding box commands to get the lowest point of that selection set. Now I want to move that selection set as a whole using the vla-move command. I am having trouble doing this. Is this possible? Can we vla-move a selection set? Is there a workaround?

View 2 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Dimensions And Selection Sets

Nov 1, 2011

I have a lisp routine that creates a "frame wall" and I want to be able to automatically dimension said wall within the same routine. I have created two sets of points, each set being on its own new layer. I have made selection sets of each set of points, and want to cycle through each set dimensioning as required. This what I have so far for this part of the routine:

(command "DIMSCALE" 24)
(setq sel1 (ssget "x" '("VPOINTS")))
(setq TC (polar (ssname sel1 0) (dtr 180.0) 9))
(command "DIMLINEAR" (ssname sel1 0) (ssname sel1 1)) "V" (polar TC (dtr 180.0) 9) "")
[code]...

When I run the program I get the error: bad point argument. So what I think is happening is that the ssname command is not returning the actual value but just the name? I am new to AutoLisp and even newer to selection sets so be easy... Along with this, I am also curious as to how a selection set is ordered when it is chosen ie how does it determine what would be in (ssname sel1 0). Also, how would one go about deleting the points in these selection sets after the dimensioning has been completed.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Paperspace Selection Sets

Jan 10, 2002

I wish to collect a selection set of blocks in paperspace of a certain name. For model space I would use the following line:

(setq x1 (ssget "_x" '((2 . "*etc*") (410 . "model"))))

when it comes to setting paperspace as the 410 ssget list value as the name can be modified and I need it to work in all drawings. I tried
setting a variable to the paperspace layout name and using a print function at the (410 . "model") point but without sucess.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Color Of Selection Sets?

Jul 27, 2013

I need to create a command which could change a color of an allready existing selection set when activated. For example i have a command which creates a cube, where each specific group of lines were added to different selection sets. how can i recall any created selection set by its name and change its color?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: VLA-MOVE A Selection Set?

Oct 3, 2011

I wrote a lisp program which creates a selection set using ssget. Then I use the bounding box commands to get the lowest point of that selection set. Now I want to move that selection set as a whole using the vla-move command. Can we vla-move a selection set?

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Remove A Selection Set From A Selection Set

Nov 15, 2013

I've created a lisp that draws the boltholes of a pipe flanges, using the correct number of holes, at the correct diameter at the correct bolt-hole diameter and then rotates.  Everything works seamlessly, when i do just one flange.  But I've discovered that fewuently there will be mulitple times when a user will have to perform the command.

So the idea I had was to do the following:

Select all circles with     (setq CirclesFirst (ssget "X" (list (cons 0 "CIRCLE"))))

Go through the code to create the new circles.

Select all circles with     (setq Circles (ssget "X" (list (cons 0 "CIRCLE"))))

Remove selection set "CirclesFirst" from "Circles".

But what for some reason (command "_.select" Circles "R" CirclesFirst "") does not work.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Selection Set During Pasteblock?

Apr 10, 2012

I'm trying to fix an issue with entlast where if the user hits escape during the process, the wrong entity gets erased, etc.  Here's the problem code...

From a function that would have just inserted a dynamic block at 0,0 then modified it - here's where we pick up..

(SETQ ss (SSGET "L"))
(vl-cmdf "_.copybase" (getvar "LASTPOINT") ss "")
(prompt "
Pick insertion point... then rotation angle ")
(vl-cmdf "erase" ss "")
(vl-cmdf "_.pasteblock" PAUSE)
(setvar "polarmode" 1)(setvar "autosnap" 63)(setvar "osmode" osm1)
(vl-cmdf "_.ROTATE" (entlast) "" (cdr (assoc 10 (entget (entlast)))) PAUSE)
(vl-cmdf "_.EXPLODE" (entlast) ""
)

I would like to do..(setq ss (vl-cmdf "_.pasteblock" PAUSE)), but of course, that doesn't work - it returns "T".

My goal is to get rid of the entlast usage from the last two lines - unexpected cancels rotate and explode the wrong entities.

If I try (setq ss (entlast)) or (ssget "L")  after the pastblock, I might still get the wrong selection set if the user hits cancel before picking.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selection Set By Block Name?

Mar 2, 2012

I am trying to select all blocks of a certian name. I am using the following:

(setq ss1bk (ssget "_X" (list (cons 2 blkname))))

My issue is that this will not select any dynamic or attribute blocks that are not at the default insert state. 

how to select all of a block by name including reguardless of current state?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Getting A Selection Set After Paste

Feb 28, 2013

Is it possible to get a selection set of what was just pasted into drawing? 

View 8 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 :: Use Selection Set For Routine?

Oct 16, 2013

with the mouse I can select objects on the screen and then start a command that uses these objects.

How can I perform this in lisp?

I can create my selection set, that's no problem, but how can I 'make it active'  for an external function?

(ssget "_C" p0 p1 '((0 . "TEXT")))
???
(c:txtexp)

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Adding To A Selection Set

Jan 27, 2003

R14 Autolisp:

I can create an empty selection set (setq EMss (ssadd)). As I loop through a list I can use the counter to create selection sets on the fly by using:

(set (read (strcat "ss" (itoa cnt))) EMss) and even keep a list of the ssets created with (setq sslst (cons (strcat "ss" (itoa cnt)) sslst)). But when I try to add an ename to the ss with (ssadd ename (read (strcat "ss" (itoa cnt))), I get a error: bad argument type (SSADD NEXTE (READ (STRCAT "ss" (ITOA CNT)))).

why I can create the sets but not add to them this way? I can add to them from the command line.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Copy Selection Set From P1 To P2?

Feb 13, 2012

I need to copy a selection set from p1 to p2.to do this I wrote the following

(defun c:test () (setq sel (ssget)) (setq p1 (getpoint "
Origine: ")) (setq p2 (gettpoint p1 "
Destination: ")) (command "_.copy" sel "" p1 p2))
 
works, but this way I can not see objects dynamically attached to the mouse cursor.

To visualize this effect, I noticed that I can use:

 (command "_.copy" sel "" pause pause)
 
but in this way I can not save the variables p1 and p2: I need for these, subsequently in the rest of thefunctions lisp.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Move Tables In Drawings?

Jan 22, 2013

I have a lot of drawings with two tables in them, and they are all over the place.

I'm able to change the columns widths using the following

(setq PipeList (vlax-ename->vla-object (car (entsel))))
(vla-setcolumnwidth PipeList 0 0.25)
(vla-setcolumnwidth PipeList 1 0.25)
(vla-setcolumnwidth PipeList 2 2.0)
(vla-setcolumnwidth PipeList 3 1.5)
(vla-setcolumnwidth PipeList 4 1.625)
(vla-setcolumnwidth PipeList 5 1.0)
(vla-setcolumnwidth PipeList 6 1.75)

I'm wondering if I could modify the assoc 10 value to a specific point of '(8.5 10.3675 0.0).

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Browse For DWG File Selection?

Apr 15, 2012

To get the 'File Selection dialog box' in AutoCAD via LISP, which command should I use other than 'GETFILED' ?

I have a program which using GETFILED to select the drawing file , but I think this dialog box size is too small to browse folder/file , as you cant see the favorites list and you cant resize the dialog box.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Folder Selection Dialogue Box?

Aug 10, 2012

I'm working on a lisp that goes through a whole list of files and does different things to those files.  I've been racking my brain for a way to select just a folder via a dialogue box, but haven't found a way.  I'm sure it can be done with dcl, but I don't know where to start. 

This would not be the standard "file" selection box, but would only list the folders and let me select one even if there are others "under" them.  This is what I'd like it to look like. 

I'm not sure if there is a standard AutoCAD box that I could call for this or not

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Setting A Previous Selection To Nil?

Jan 12, 2012

How to Set a previous selection to nil from say a move command? 

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Dimension Between Two Points In A Selection Set

Nov 1, 2011

Looking to make a selection set of points that are on a specific layer, and then create a dimension between, in this case, two points. I feel like it should be very simple, but I can't get it to work for the life of me. Here is the test code I've been playing around with:

(defun c:test (/ sel1 TC)
(setq sel1 (ssget "X" '((8 . "VPOINTS"))))
(setq TC (polar (entget (assoc 10 (ssname sel1 0))) (dtr 180.0) 9))
(command "DIMLINEAR" (entget (assoc 10 (ssname sel1 0))) (entget (assoc 10 (ssname sel1 1))) "V" (polar TC (dtr 180.0) 9) "")
[code].......

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Exploded Block Into A Selection Set

Feb 8, 2012

How to get the individual components of a block that has just been exploded within a lisp routine into a selection set. I want to alter the layer of each element to the insert layer of the block. I may also make one or two other changes according to what I find in the block.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Window Selection Of Attributes

Oct 16, 2012

I downloaded a lisp routine that will align block attributes. The problem is I can only select the attributes one at a time. I'd like to be able select multiple attributes using the selection window or a crossing window, but I haven't had much luck. If you use the AEATTSHOW command, it give you a prompt to "select using window" by pressing W. I'd like to have the same functionality for my Align attributes routine.

Below is the portion of code I currently have to select attributes one at a time:

;* Select all attributes to align with the parent selected above and add the attribute entname and the block
;* entname to a list in format ( (AttrEntName BlkEntName) (AttrEntName BlkEntName) (AttrEntName BlkEntName) )
;*
while (/= TempAttr nil)
(setq
TempAttr (nentsel "
Select Attributes to align: ")

[Code] .........

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Existing Selection Set?

Sep 5, 2012

I need the same funcionality as in code below, but without using "command".

The main idea is alowed user to modify Existing Selection Set.

 (defun gt:ss->lst (a:ss / i lst ) ;_ / (setq i 0) (if a:ss (progn (repeat (sslength a:ss) (setq lst (cons (ssname a:ss i) lst) i (1+ i) ) ;_ setq ) ;_ repeat (reverse lst) ) ;_ progn ) ;_ if) ;_ defun gt:ss->lst(defun gt:ss_modify (a:en-lst / ) ;_ / ;;create Selection set (setq ss2 (ssadd)) (foreach f:en a:en-lst (ssadd f:en ss2) ) ;_ foreach ;;Run command and fill with initial content (command "_select" ss2) ;;Alow the user to modify the contents (while (/= (getvar "cmdnames") "") (command pause) ) ;_ while ;;get back the list of enames from modified selection set (setq ss3 (ssget "_P")) (setq ss3-lst (gt:ss->lst ss3))) ;_ defun gt:ss_modify(defun tst:gt:ss_modify ( / ) ;_ / (gt:ss_modify (gt:ss->lst (ssget)))) ;_ defum tst:gt:ss_modify

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Retrieving ActiveX Selection Set

Feb 7, 2013

Tried retrieving an ActiveX selection set in AutoCAD 2013 (AutoCAD Architecture 64bit on Windows 7 is what I am using)?

Using a piece of LISP I got from the ADN developer site, it no longer works and gives this error....

Cannot invoke (command) from *error* without prior call to (*push-error-using-command*).
Converting (command) calls to (command-s) is recommended.

(defun c:erset (/ acApp acDoc selSets ss1)
(vl-load-com)
(setq acApp (vlax-get-acad-object))
(setq acDoc (vla-get-activeDocument acApp))
(setq selSets (vla-get-SelectionSets acDoc))
[code].....  

Unfortunately my lisp is very basic.

(defun c:getSset()
(vl-load-com)
(setq ss-vba (vla-item
(vla-get-selectionsets
(vla-get-activedocument
[code]......

What about creating an AutoLisp selection set from .NET - is it possible, if so I would prefer to do that instead?

The goal is to create some objects in .NET (using activeX or managed code) and then have some way to access these objects via the command line I'm assuming they only way is using an AutoLISP selection set.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Copy / Move All Entities In Two Coordinates

Jul 16, 2013

I am having nearly 1000 drawings where I need to change the title block in a new format.

I am stuck up in moving all the entities  in  cordinates 15,280 (upper point) and 205,55 (lower Point) to 275,294 (upper point and correspoing lower point.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Move Selected Objects By Value Of Their X Or Y Properties

Nov 23, 2012

I need a program to move some selected text to a line something like as extend command but for text objects!

suppose that there is a horizental line (y=constant) or vertical line (x=constant) and some selected text(or other objects), I want a lisp program that move these selected text (or objects) by their "insertion point" to this line.

in other word, if the selected base line is horizental (y=constant) then property of "Y" of all selected text should change to line's "Y"; and if selected base line is vertical (x=constant) then value of "X" of all selected text should match to line's "X" value.

for example, for base vertical line (x=constant) and 3 selected text(or can be any object) result is:

text1.          |                        text1.|

  text2.        |         ===>       text2.|

    text3.      |                        text3.|

|  .text1                                 |.text1

|    .text2                ===>       |.text2

|      .text3                             |.text3

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Disable Command MOVE On Reactor?

Feb 7, 2012

I use the following code to assign a reactor to an object:

(setq marReactor (vlr-object-reactor (list (vlax-ename->vla-object oggmar)) "TEST" '( (:vlr-erased . reactor_upd) (:vlr-modified . reactor_upd) ) ))
 
"reactor_upd" is the name of the function that starts every change or delete the object.

I would like to exclude the command "MOVE", ie if I move the object, I do not want that part to the"reactor_upd" function.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Move Multiple Text To Line

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

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 :: How To Move The Selected Object Using ObjectDBX

Aug 7, 2013

Using Nentsel function, I can get info on a object that is nested with an Xref. Is there a way to move the selected object using ObjectDBX?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Nil Not Giving Desired Response In Selection

May 7, 2012

I use menu's based upon the following snippet:

(if (or (equal choose "1"))(MYFUNCTIONSDEFINITION))
  works a treat, its easy for me to understand even if maybe not totally orthadox in method.

So I can populate my code to have multiple selections such as follows.
 
(if (or (equal choose "1"))(MYfunctionDEFINITION1))(if (or (equal choose "2"))(MYfunctionDEFINITION2))(if (or (equal choose "3"))(MYfunctionDEFINITION3))

 and so on, but the example above caters for situations the users enter the values of 1, 2, or 3. If the user enters anything else I get a nil response from AutoCAD. So I devised the following

(if nil (alert "Wrong selection"))
  
but no response from AutoCAD qua an alert

also tried to be more in uniform with the rest of the lisp and wrote
 
(if nil (MYalertRESPONSE))(defun MYalertRESPONSE ()(alert "Wrong selection"))
 
also fails to yield the desired response.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Filter Selection Set By Substring With SSGET?

Apr 20, 2012

I have some strings like the ones below. They are always in the same format. The first line is Cold Water, the second is Hot Water and the third is Hot Water Return.

I want to build a selection set based on whether it is CW, HWS or HWR. Right now I have a routine to retrieve the string by using ENTSEL. In other words if I want to use the line of text for Cold Water I have to select it.

I'd like to be able to window them all and filter the SS for only the string containing CW and conversly HWS and HWR. SSGET function filter.

"2''CW-52.0 WSFU"
"2''HWS-48.0 WSFU+12 GPM"
"1"HWR-12 GPM "

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Make Fillet With Window Selection?

Jul 11, 2012

It's possible make a fillet with window selection?

View 4 Replies View Related







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