AutoCAD Visual LISP / AutoLISP :: Add Segment To A Leader?
May 11, 2012
I've managed to retrieve the important points of a leader with the following
(setq edata (entget (entlast)))
(setq leader? (cdr (assoc 0 edata)))
(cond
((= leader? "LEADER")())
(T(setq edata (cdr (entget (car (entsel "
Pick a leader: "))))))
)
[code].....
What I'd like to do is add a horizontal segment of a known length to the leader, obviously based on the last point. I have to assume that the user is in the appropriate UCS for this, but I can trouble shoot for that later.
subst old list iwth a new list and apply it to the entity somehow?
View 9 Replies
ADVERTISEMENT
Jun 1, 2006
Is there a way to have the Arrow leader convert to Loop leader in one click. Our company standards use diamond tags and sometimes i have to change the arrow to loop by inserting a leader.
View 9 Replies
View Related
Dec 18, 2011
I have to intersect polylines "POLYLINE" and "LWPOLINE" with a line and get all the angles of all segments of the polyline that are intersected.
To do this I used a loop that monitors all the vertices of each polyline to find the two vertices of the polyline segment that intersects the line. Unfortunately, these polylines have thousands of vertices and the processing done in this way takes too long.
With the vlax-curve-getClosestPointTo I could very quickly find the vertex of the polyline closest to that intersected with the line, but I need to find the other vertex of the polyline segment to determine the angle of this.
Another question: is there a quick function that returns the exact point of intersection of two curves (e.g. A line and a polyline, or a line and a circle?
View 9 Replies
View Related
Mar 19, 2013
I am writing a routine that will place a piece of text at a specified point along a polyline. My problem is to determine the angle for the text. It needs to be the same as the segment of the polyline that it falls on. Just can't get my head around how to get that angle?
I can get a list of the vertex point of the polyline, but how do I determine the segment the point falls on?
View 3 Replies
View Related
May 3, 2012
Our customer send us drawing with ellipse segments into.
With Autocad 2008 I bought a plug-in call SplineConvert that did the job perfectly but not compatible with 2013.
Is there any plugin that could replace that tool ?
Is there any standard ACAD command that could easily do this Job ?
I need a way to make 2 or 3 times per week this converting on all ellipses of large and detail 2D drawings so no time to offset in and out all those .
I try also DXFOUT in R12 but all the spline are being converted into 3d polyline making a huge files that froze my PC.
I also try FLATTEN but did not see how it work , the ellipse stay an ellipse.
View 7 Replies
View Related
Feb 6, 2006
Have Lisp to place aligned dimensions on each segment of a polyline?
I would use it for reinforcing bar detailing.
View 9 Replies
View Related
Nov 27, 2011
I'm trying to create a leader with no attachments. Code below. But I can't seem to shut of the Annotation Dialog.
(setvar "cmddia" 0)
(vl-cmdf ".Qleader" "S" "A" "N" pt1 pt2 "" )
Also I am trying to create a leader with text that is aligned and above the leader line.
View 6 Replies
View Related
Apr 18, 2012
Here's my Lisp routine.
(defun c:ll() (errorek) (setq akt_lay(getvar "clayer")) (setq akt_dimldrblk(getvar "dimldrblk")) (setvar "clayer" "ELEMENTS_NO") (setvar "dimldrblk" "_DOTSMALL") (command "qleader") (setvar "clayer" akt_lay) (setvar "dimldrblk" akt_dimldrblk) (setvarki) )
(defun setvarki() (setvar "Filedia" filedia) (setvar "osmode" osmode) (setvar "orthomode" orthomode) (setvar "autosnap" autosnap) (setvar "cmdecho" cmdecho) (setvar "dimse1" dimse1) (setvar "dimsd1" dimsd1) (setvar "dimjust" dimjust) (setvar "dimldrblk" dimldrblk) );defun
(defun errorek() (setq MojError *error* *error* WlasnaObslugaError filedia(getvar"filedia") osmode(getvar"osmode") orthomode(getvar "orthomode") autosnap(getvar "autosnap") cmdecho(getvar "cmdecho") dimse1(getvar "dimse1") dimsd1(getvar "dimsd1") dimjust(getvar "dimjust") dimldrblk(getvar "dimldrblk") );setq);defun
What am I going to do?
1. I want to have default leader arrow - "closed filled".
2. In lisp routine from "code 1" I want to put leader (actualy leader without text) with arrow "dotSmall".
3. When I press [Esc] during drawing leader I want to set up back default leader head as "closed filled".
Why my routine doesn't work properly?
View 2 Replies
View Related
Nov 29, 2011
I am looking to modify a block count lisp, the lisp counts the blocks and displays them in the command line. I am looking to take that list and insert it in to a leader.
So it will prompt me to select blocks.
1st Point of leader
2nd point of leader
and would generate the block list in the leader annotation.
View 9 Replies
View Related
Oct 24, 2013
Is there a way to attached an already exisiting placed block to a leader. If so, is there a way to do it to all the existing blocks, that are of the same block definintion, at once?
View 2 Replies
View Related
Sep 21, 2004
Code to convert a spline or read its points so I can create a curved leader (with arrowhead) reasonably close ?
View 9 Replies
View Related
Mar 19, 2013
have a simple lisp (no v.b.) program that changes the color of m-leader lines in acad 2010?
IV 2010 Suite
Digital Storm PC:
EVGA & Intel components
Win 7 Pro 64 bit
View 9 Replies
View Related
Nov 16, 2012
Is there a way to modify the text insertion point of multileaders using lisp? We have a problem with some of our multileaders getting a landing distance set to a negative value. My lisp routine will correct these to a default value, but then the text jumps a bit. If I could get the insertion point prior to changing the landing distance then I could restore that point after changing the landing distance.
;;-------------------------------------------------------------------------------------------------(defun c:zld (/ e th dogleg doglegllength sf ss c mlss mlcount) (setqss (ssget (ssget "X" (list (cons 0 "MULTILEADER"))))DWATxtHgt (getvar "userr1")sf 1dogleg (/ 3 32.0)th (if dwatxthgt dwatxthgt dogleg)c 0mlcount 0mlss (ssadd)) (IF ss (while (< c (sslength ss)) (setq e (vlax-ename->vla-object (ssname ss c)) c (1+ c) ) (= (vla-get-ObjectName e) "AcDbMLeader") (progn;;change the dogleglength if
[code].......
View 7 Replies
View Related
Aug 28, 2012
I have a customized button to draw an ‘ac-arrow’. I created a lisp to create the layer “G-ANNO-LEDR”
if the layer name is not found. The advanced part I would like is:
Current layer: E-ANNO-WIRE
Ac-Arrow Leader: G-ANNO-LEDR
OPTION 1:
If, say I am on current layer “E-ANNO-WIRE” and need to draw my “ac-arrow” leader, and continue working
on the original layer “E-ANN-WIRE” (and have the leader be drawn [remain] on the layer “G-ANNO-WIRE”).
With this option, I have the block “ac-arrow” imbedded in my template drawing file to have the block at hand.
With this option, the layer “G-ANNO-LEDR” will be created IF it is not on the drawing.
OPTION 2:
- Currently be on layer “E-ANNO-WIRE”
- Bring in the block “ac-arrow” from my block library “L:AutoCADSymbols”
- Draw the “ac-arrow” leader which will be on layer “G-ANNO-LEDR” (this layer created IF it is not
on the current drawing).
- After the leader is drawn’
- Be put back to the layer I was, “E-ANNO-WIRE”, and continue working.
The OPTION 2 is what I would really like to have. A while back, I happen to see one like OPTION 2, but I cannot
find it anymore on the users groups. I have been searching for a while now.
Currently, I use the button in my customized toolbar (see image) and have to have the “ac-arrow” block in my drawing and have its layer created in the drawing.
View 1 Replies
View Related
Jul 12, 2012
Is there a lisp that will allow me to do a continuous dimension, but will alternate the dimension position from low, high, low and high? If there is no lisp already created, how to create one?
See Continuous dimension attachment for example.
I work at a glass and glazing company and this is how we dimension mullion width and DLO. See typical window dimensioning attachment for window elevation with dimensions.
View 6 Replies
View Related
Nov 14, 2013
I have a list ("temp.dwg" "temp2.dwg") and would like to add the string "insert text here" into each item in the list resulting in ("insert text heretemp.dwg" "insert textheretemp2.dwg"). how would i go about doing that using LISP?
View 2 Replies
View Related
Oct 7, 2013
Is there a way to programatically set a visual style before a drawing actually opens?
We have some huge models and people seem to forget to change their visual styles back to 2D wireframe before saving and exiting drawings. Some models will crash on some workstations when trying to open in a rendered mode.
I found a lisp with a function that looked to set viewport visual styles. But it does not seem to be supported anymore. --> (vla-put-VisualStyle vport 1)
View 9 Replies
View Related
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
Jun 20, 2013
Lisp that switches back on Selection Preview i.e. thickens and highlights lines when you hover over them?I don't know why, but they are always unticking the boxes.
View 4 Replies
View Related
Sep 7, 2012
Is it possible to execute a certain command based on multiple selections withinin a dcl? for example: two radio colums, one with selections A and B, and a second with selections 1 and 2. is it possible to program commands based on user selections from each column? ex: if A and 1- do a command. A 2- do a different command, etc...
I tried :
(action_tile "key1" "(setq A t")
(action_tile "key2" "(setq B t")
(action_tile "key3" "(setq 1 t)(done_dialog)")
(action_tile "key4" "(setq 2 t)(done_dialog)")
(if
(and (a) (1)
)
(command ...
but was unsuccessful. no matter which combination was selected, the command under all combinations would run.
View 2 Replies
View Related
Jun 3, 2013
I am trying to find a lisp that would get an attribute value (tag name = NBR_5) . I'm trying to run a simple routine that would let the user place the value from the titleblock attribute as text on a drawing. I see a ton of articles regarding getting attributes but I am not well versed in programming.
View 9 Replies
View Related
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
Oct 9, 2013
I'm trying to find acceptable point values to feed to the vlax-3d-point function for a vla-addmtext function. With vanilla lisp I just provide the point as x y = "7/32" "2-3/8". So I assumed that I could drop a 0 in for the z like: (VLAX-3D-POINT "7/32" "2-3/8" 0).
Then I thought I was going to be tricksy and try (vlax-3D-point (getpoint)) believing that I could pick the point and get what I need to feed the function, but yet again, no deal. The command line gave me:
node
of #<variant 8197 ...>
Nothing I can use in my code. So how do I find the point in a format that vlax-3d-point will like?
View 9 Replies
View Related
Dec 19, 2011
What is the magic word for put a point at each end of an arc, the lisp I have only put a point at center of the arc.
(defun cAA ( / i j ss e1 e2 p1 p2 p3 points )
(if (setq i -1 ss (ssget '((0 . "ARC"))))
(progn
[Code].....
View 5 Replies
View Related
Dec 30, 2011
Is there a quick way of getting the value of an attribute?
I have an attributed block called "tp_attributes" and it has and attribute called "OrderNum".
I just want to be able to quickly grab that value.
View 3 Replies
View Related
May 29, 2013
I use Spell Check regularly and I always check the entire drawing. I would like to add to the Spell macro so that when I pick Spell from the toolbar it goes past the Check Spelling window and begins checking the entire drawing.
I believe I need to insert Alt S into my macro to select Start from the window to begin the check. Is there a character or series of characters that will represent Alt in a macro?
View 1 Replies
View Related
Nov 8, 2011
I upgraded from Autocad 2004 to 2012 recently and my lisp file doesnt work anymore.
what it's supposed to do is when looking at the layout tab that you want you can switch to the model space location of the same zoom as the layout tab without messing with the layout zoom.
(defun c:msp ()
(setq cm (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command"view" "d" "tmp")
(setvar "tilemode" 0)
(command"pspace")
(princ "Click TWICE on desired VPORT: ")
(command "mspace" pause "view" "s" "tmp")(princ)
(setvar "tilemode" 1)
(command "view" "r" "tmp")
(setvar"cmdecho" cm)
(princ)
)
View 4 Replies
View Related
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
May 10, 2012
I have text objects with the same Z value and I will select as follows:
(setq sstxt (ssget '((0 . "TEXT")(8 . "APS-text"))))
How to store this value in another variable "zvalue" to apply to:
(command "change" "select text objects" "" "_p" "_e" zvalue "") ?
View 9 Replies
View Related
Oct 17, 2011
the following returns true since the @ symbol tests for an alpha character.. (wcmatch "S101" "@*").What is the Dot Net equivalent?
View 2 Replies
View Related
Jul 10, 2012
Is there a command that is the opposite of starting an application to open up a file? Like:
(startapp "PlaySound.exe" (findfile "CuckooClock.wav"))
Instead of starting an application, how to shut all of its instances down. Let’s say I have iTunes and/or Internet Explorer w/ a few tabs open and I can close them down without getting to the application to terminate it the usual way.
Naturally,
(endapp "iTunes.exe") doesn’t work :-))
View 3 Replies
View Related