AutoCAD Visual LISP / AutoLISP :: How To Make Selection Set After Break Command

Nov 19, 2011

The following function

(command "_break" ent1 p1 p2)

break a polyline into two separate polylines. How can I get a selection set with two separate polylines?

View 4 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Break To Break At Point Command

Mar 19, 2010

Is it possible to change te Break command permanently in the Break at Point command?I never use break, only break at point.

Changing te macro for break ^C^C_break to the macro for break at point ^C^C_break \_f @ doesn't work.

To do it manualy at the command prompt takes to much keyboard entries and mouse clicking.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Start Command On Existing Selection Set?

Jan 29, 2012

I'd like to pass and existing set of selection to a command like laylck, which asks for selections after beginning the command. 

It must be possible to do this. Some CUI setup, lisp routine?

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

AutoCAD Visual LISP / AutoLISP :: How To Make Ctrl-V Always Paste To Command Line

Dec 17, 2012

I rarely paste entities using ctrl-v, I use the WTIT.lsp commands instead, or edit pulldown to paste entities.

I want a CTRL-V to paste to command line, always, no matter what.

I tried killing the keyboard shortcuts through the CUI, but that just stopped ctrl-v from doing anything when I was not on command line.

[URL] ....

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Set Dim Break Size

Mar 16, 2007

How to set the dimbreak size for their dimstyles (I'm sure it can be tweaked a bit... but works ok as is):

(defun SetDimBreak (DimstyleName Value / ds edata xdata newxdata i ent)
(if
(and
(tblsearch "dimstyle" DimstyleName)
(setq ds
(vlax-vla-object->ename
(vla-item (vla-get-dimstyles
(vla-get-activedocument (vlax-get-acad-object))

[Code]....

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Set Dimension Break Size

May 17, 2013

I there any way to set the dimension break size in autolisp ?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Dimstyle Break Size Variable?

Aug 28, 2009

I want to set the break size in all of my dimstyles but I can't find a system variable for it. know what it is or how else to set it?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Repeating Break At Single Point

Nov 7, 2011

I'm creating the following macro:- (defun C:BK () (command "_BREAK" PAUSE "_F" PAUSE "@" )(princ)) to add to a shortcut key lisp file and then I want it to repeat... How do I make it repeat?

I want it to do the same as this:- *^C^C_break \_f @ but as a shortcut key in a lisp format.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Break Lines Horizontally And Vertically

May 14, 2013

a routine that has the option to break vertical or break horizontal, depending on the option, the lines that cross either the horizontal or vertical (again, depending on the option) a specified distance (say .05) on either side of the line you wanted to keep.  So if I choose BREAKH, the vertical lines that I choose would break any horizontal lines that cross them.  Same applies to BREAKV.  Hopefully I communicated clearly enough. 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Annotation Command Set Correct Layer For Duration Of Command

Nov 21, 2010

I am currently writing a series of routines for setting the layers for text, leaders and dimension commands. The end goal is a system where any annotation command sets the correct layer for the duration of the command, then reverts back to the layer that was active before the command.

I have managed to complete all the code, and it appears to be working fine, I just have one question: I have used -layer "m" "Lay_name" etc... for all layer setting commands, rather than any code to see if the layer exists already. In my limited testing this seems to be suitable, nothing that exists on that layer seems to be affected.

I know how to write code to determine if the layer exists already and set the layer instead, but so far it seems unnecessary??

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 :: Write A Lisp Routine That Invoke The Mleader Command

Oct 11, 2012

I'm trying to write a lisp routine that, when I invoke the mleader command, osmode is set to "nearest" & orthomode is set off. I then would like the original settings to be returned.

attached is what I have written so far:-

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Nil At The End Of Command

Jun 22, 2012

I have a routine that work fine, but I receive a nil at the end of command. How to fix that?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: DOS DIR Command

Oct 27, 2012

I need a program that simulate this DOS command: dir /on/b *.dwg >list.txt

it list all dwg files on current open dwg file folder and sort them and finally put them in a text file with list.txt name. something like thistype list.txt)

test1.dwg
test2.dwg
test100.dwg
test256.dwg
test1005.dwg

(sort alphabetically and logically) because of disabled DOS utility in my PC I need a pure lisp functions, I tried to wrote this program but I couldn't!!

(defun c:listMaker()
(vl-load-com)
(setq path (getvar "dwgprefix"))
(setq fn "list.txt")
[code]...

and also I need a append a string(='This Is EOF') in the last line of the "list.txt" file.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Can't Get While Command Right?

Apr 13, 2012

I am trying to get my original layer and lintype reinstated after the user is finished with the pline..I know Im suppose to use the while command but am now completely lost on which way to do this

(DEFUN c:TEST1 ()(if (not (tblsearch "LTYPE" "MYWC")) (command "-linetype" "LOAD" "MYWC" "C:/COUNTER.LIN" ""));SECOND PROGRAM...;CREATE CORESPONDING LAYER...(command "._Layer" "Make" "WC LEIDING" "Ltype" "Continuous" "" "Color" "211" "" "")(SETQ MYOLDCELTYPE (GETVAR "CELTYPE"))(SETVAR "CELTYPE" "MYWC")(while (PROGN(COMMAND "pline")(SETVAR "CELTYPE" MYOLDCELTYPE)))

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Error In While Command

May 22, 2013

We have a lisp routine that I co-authored ages ago and then haven't done much programming in about 7 years.  I seem to have forgotten much of my language skills.  This portion of the lisp routine was running fine in autocad 2005 which is what the computer had on it, and it doesn't run on autocad 2010. 

I've narrowed it down to the while statement which is why you see it commented out, but that portion is necessary.   My main question is was there a change in the language specifically the while statement between 2005 and 2010? 
 
; GET LINES OVER 10" AND THROW OUT (if (= (cdr(assoc 0 outerinfo)) "LWPOLYLINE") (progn (setq remlenouter 0.0) (setq numseg (cdr(assoc 90 outerinfo))) (setq edd (member(assoc 10 outerinfo) outerinfo)) (setq n1 0) ;(while (< n1 (- (* numseg 4) 4)) ;(setq dist (distance (cdr(nth n1 edd)) (cdr(nth (+ n1 4) edd)))) ;(if (>= dist edmmax) (setq remlenouter (+ remlenouter dist))) ;(setq n1 (+ n1 4)) ;) ; end while (setq dist (distance (cdr(nth n1 edd)) (cdr(nth 0 edd)))) (if (>= dist edmmax) (setq remlenouter (+ remlenouter dist))) ) ; end progn ) ; END IF

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Looping A Command

Aug 26, 2013

I am using AutoCAD 2011. I have a lisp that I have created/modified.

What it does:

Allows me to Select a layer that I call out and change its color properties back to bylayer.

(i primarily use this when i am cleaning up my drawings, I turn them all to gray with another command i have then i run this one to find all the entities on that specified layer)

What i am trying to do: 

I would like this command to do a loop.  So say i type in a layer name that does not exist, instead of running through the rest of the command i want it to revert back to "specify layer name" until the correct name is entered for that layer.

Here is the lisp:

(defun cLL ()
(setq varLayer (getstring t "
Specify Layer Name: "))
(sssetfirst nil (ssget "X" (list (cons 8 varLayer))))
(command "change" "p" "" "p" "c" "bylayer" "")
(princ)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Check For Last Command

Jan 8, 2014

We have developed processes, standard operating procedures, work instructions (whatever you want to call it) for several tasks we do on a regular basis.  More importantly, tasks that we don't do on a regular basis.  On some processes, performing certain commands is a critical step in the quality of the product.  I have also developed a lot of lisps to streamline these processes.  Of course there are commands that just don't make sense to try and include into existing lisps.

The problem we're having though, is that people are not following the processes.  I don't know if they think they are smarter than the process, or if they don't understand the process, or if they are just complacent.

One of the things that would really work to get everyone to follow the process, is to have my lisp routines check to see what the last entry at the command line was.

For example, if one of my lisps depended on the drawing be saved, well, instead of putting the save command in the lisp, sometimes it would be beneficial to check to see if the drawing was saved in the first place.  Kudos to those who do follow the process, they do save the drawing, and then run the lisp.  On rather large files, I would prefer not to save the drawing twice, back to back.

There are a lot more benefits to checking to see what the last user entry was, in a certain drawing. 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: DCL Command Locking Up

Aug 8, 2012

 I am new to DCL programming and am having an issue getting a button to recognize a command.  As a simple first attempt, I am trying to create a dcl with a button called "draw test line"  that will draw a line from 0,0 to 1,1.  The lisp loads correctly and the "cancel" button works fine.  However when the "draw test line" button is pressed, autocad locks up and the only solution is to restart.  here is the dcl

testline : dialog {
          label = "draw line test";
          : column {
            : boxed_column {
              : button {
                key = "but1";
                label = "draw a line";
                is_default = false;
[code]....

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Can't Redefine ID Command

Nov 5, 2013

I've written a script that improves the default "ID" command, but it's not working.

I was able to redefine the "DI" command.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Return Last Command

Jun 27, 2013

Trying to diable the spacebar = (return last command) function!

commandlinehide does te job in the working interface, but a space in scriptmode (in the filename e.g.) still repeats last command!

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 :: 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 :: 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 :: Control UCS Without Using Command Line?

Nov 9, 2012

Is it possible to control the UCS without using the command line?  I'd like to access it and control it with vlisp much the same way I can access DXF groups and manipulate insertions.  Seems like it should be possible to play with it's definition inside the object model.

View 5 Replies View Related







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