AutoCAD Visual LISP / AutoLISP :: Convert Spline To Curved Leader?
Sep 21, 2004Code to convert a spline or read its points so I can create a curved leader (with arrowhead) reasonably close ?
View 9 RepliesCode to convert a spline or read its points so I can create a curved leader (with arrowhead) reasonably close ?
View 9 RepliesIs 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 RelatedOur 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.
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?
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.
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?
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.
I am working on a little lisp routine to draw splines, but can't get it working. The basic idea is that i first select a set of points that i can feed to my spline command.
(defun c:test2 () (setq pt (getpoint "
define point:")) (setq ptlist nil) (while (not (equal pt nil)) (setq ptlist (cons pt ptlist)) (setq pt (getpoint "
define point:")) ) )
Now i need to draw a spline based on these points. My plan whas to simply use the acad command itself. But this option didn't work.
(command "spline" ptlist "")
Then i tried using the vla-addspline command. But i can't even get this one working .
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 RelatedLet's say I have a 3D polyline, which I turn into a spline. I then want to determine how closely the original polyline and spline follow each other. How I can check this programmatically? The concern is to find the maximum deviation and its location.
Howto be able to run the check on other types of objects as well: arc, polylines etc.
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
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].......
Due to modeling purposes, I need to convert a 3D polyline to a spline. What I have been doing is:
- change polyline fit/smooth to cubic from properties
- convert polyline to spline by typing spline -> object
- method -> fit from properties
You can see the original 3D polyline (green) and the resulting spline (magenta) in the attached drawing.When I zoom in and measure the distance between the two entities at different points along them, at some points the perpendicular distance exceeds 5 millimeters, and I want to ensure the deviation remains under 1 millimeter or even less.
I know I can change the knot parameterization of the spline, and this does work at some locations, but the difference increases at others.Why is there a 5.6 mm difference between the spline fit point and 3D polyline vertex, as measure in the attached drawing?
Now, I can go and manually stretch the fit point to coincide with the vertex. Also, I can add fit points between existing ones to drag the spline closer to the original 3D poly.
However, some of my polys are really long, and it is very time-consuming to do this manually while measuring points along the entities to make sure the distance stays small enough.
how to automate this process? For example a lisp that would maybe take the original vertex points, add say maybe 3 (not too many) new ones between them, and then generate a spline while making sure the deviation is less than the set value of 1mm? I am using AutoCAD 2013.
My work needs to convert thousands of DGN files to DWG. We are using AutoCAD 2012. Is it possible to batch convert dgn files with a LISP and a mapping file?
View 9 Replies View RelatedI have a list that is "acl", I would like to convert it to a string "acl", everything that I have read uses alot of code. Does this really take that much code to do?
View 9 Replies View RelatedI 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.
is there a way to convert multiple 2d solids to hatches.
View 9 Replies View RelatedWhat is the Command that Converts a Field to Text so that I can stop a Field updating after the initial set-up? I need to apply this in lisp.
View 9 Replies View RelatedI need a lisp code to convert all Lines, Polylines, Arcs and Splines to Polylines with 0.4 width.
I prepare this:
(defun c:CH2pl ( / SS);changes all lines, plines, arcs and splines to POLYLINE with 0.4 width(if (setq SS (ssget "_X" '((0 . "LINE"))))(command "_.pedit" "m" SS "" "Y" "w" 0.4 ""))(if (setq SS (ssget "_X" '((0 . "*POLYLINE"))))(command "_.pedit" "m" SS "" "w" 0.4 ""))(if (setq SS (ssget "_X" '((0 . "ARC"))))(command "_.pedit" "m" SS "" "Y" "w" 0.4 ""))(if (setq SS (ssget "_X" '((0 . "SPLINE"))))(command "_.pedit" "m" SS "" "Y" 10 "w" 0.4 "")))
But I want pure lisp code in a professional way!
I have searched the web and the Autodesk Discussion Group for a LISP Routine that allows me to convert all attributes in a drawing to Layer 0 but i have had no luck. It would be great if the LISP could edit xrefs as well although not sure if this is possible.
**BATTMAN command will take too long for the hundreds of blocks, xrefs and drawings i need to edit.
I wrote code for an application that stores links to lines and blocks in dictionaries using handles. The routines work well and I can manipulate the data marvelously, but if one of the lines or blocks get erased the whole danged opera falls apart. I knew this when I wrote the routines and have always been careful about using the ERASE command, as a matter of fact, I considered disabling it.
I am trying to make the package more robust. I have been experimenting with attaching a reactor (:vlr-erased) to the objects which fires when the object is erased. Unfortunately it fires before I can retrieve the handle of the object so that I can remove the references from the dictionaries. The only thing that I can retrieve once ERASE fires is the ObjectID. I can't seem to find a Visual Lisp routine to convert this value to a handle, does one exist? Is there an ObjectID collection that has any references in it?
I am trying to shorten my code by using the variable as the command name. Is that possible to do?
;; instead of this(cond ((eq USER_INPUT_ANSWER "blk-cdtree-01-06")(C:blk-cdtree-01-06)) ((eq USER_INPUT_ANSWER "blk-cdtree-01-08")(C:blk-cdtree-01-08)) ((eq USER_INPUT_ANSWER "blk-cdtree-01-10")(C:blk-cdtree-01-10)) ((eq USER_INPUT_ANSWER "blk-cdtree-01-12")(C:blk-cdtree-01-12)));; do something like this(C:blk-cdtree-(substr USER_INPUT_ANSWER 11))
I am trying to finalize a routine which extracts attributes (created in all CAPS) from a drawing, does a bit of list handling and then will finally write each item of that list to its own line out to a TXT file.
I've had a request from an end-user to change the case of the words in the TXT file from all UPPERCASE to having each Word Capitalized Within Each Item :
e.g. :
the raw list is currently:
"DINING ROOM 1209" "LIBRARY1210" "CORRIDOR A100" "COPY ROOM 1215"
and the current output to TXT file:
DINING ROOM 1209
LIBRARY1210
CORRIDOR A100
COPY ROOM 1215
But I'd like the list to be processed within AutoCAD so that its format is changed to:
"Dining Room 1209" "Library 1210" "Corridor A100" "Copy Room 1215"
because the desired output to the TXT file is:
Dining Room 1209
Library 1210
Corridor A100
Copy Room 1215
Is there any way to convert ALL CAPS to more of a Capitalized format?
I have a list of (0 .4 .8 0 10). I want to convert every element of the list to string.
View 4 Replies View RelatedAny routine or way to convert a nested xref to a regular xref?
View 4 Replies View RelatedJust going over some old stormwater flows but have some other stuff included in the coordinates I have, is their anyway to convert lines to points?
I know a long way but im just seeing if theres a quick lisp routine that can do it for me?
I have a data structure called LayerList in the format [LIST "LayerName" "Linetype" Thickness Color]I then use the following piece of code to go through the structure selecting polylines and converting all polylines on a given layer to the correct thickness
(foreach layr layerlist
(setq player (car layr))
(if (setq ss (ssget "x" '((0 . "*polyLINE") (8 . player ) )))
(command "pedit" "m" ss "" "w" 0.15 "")
(princ "
No polylines exist!")
)
)
However all i keep getting is Bad SSGET list value at the command line,
I need a function that allows to convert the polylines selected with a width globalize defined in a double closed line (spaced by the same width of the polyline), with a hatch inserted automatically defined.
Brilliant idea to draw raceways quickly: instead of making handmade double lines, connect, enter the hatches all by hand, you could quickly draw the polyline with width identical to the size of the duct, and then the lisp transform it into a duct more aesthetically pleasing if compared to the full polyline!
Looking for a lisp to convert a poly face mesh to a solid.
View 1 Replies View RelatedHow to convert the format obtained in "CDate" in absolute minutes?
ex:
Command: (rtos (getvar "CDate") 2 4)
The result is:
"20130326.1301"
What I need is:
+01 minuts
+13 hours X 60 = 780 minuts
+26 x 1440 = 37440 minuts
the current time this month is: 38221 minutes
Looking for routine for converting text to attributes inside the block?
In my drawing I hv some attribute blocks having some Text in it. I need to change the Texts inside the blocks as Attribute Texts. I am attaching sample Blocks drawing..