AutoCAD Visual LISP / AutoLISP :: Convert Polyline - Bad SSGET List
Feb 5, 2013
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,
View 3 Replies
ADVERTISEMENT
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
Oct 9, 2013
I'm trying to look for a LISP command where i will create a closed polyline with 4 sides in different angles. then convert it to region.
View 6 Replies
View Related
Jul 17, 2012
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 Related
Jan 6, 2014
I've been twigging around with a selectionset, but no luck. I need to build a ss with several named blocks and a few dynamic blocks which get selected as anonymous. Unfortunately not all dynamic blocks should be selected and I can find no way of either filtering out a list of dynamic blocks to exclude nor any way to campare to a list of dynamic blocks that I want selected. Below is the best idea that I had but if I wrap it into a foreach with an exclusion list, I get an empty selection set returned. (I'm guessing that I need to trim the pairs each iteration and only return the matches instead.)
(SETQ blklst (LIST "Cleaner" "DRAIN" "Return" "Therapy""PoolLight" "Paraleveler" "Waterleveler" "Skimmer" "UMSLEEVE") blst "Cleaner, DRAIN, Return, Therapy,PoolLight,Paraleveler,Waterleveler,Skimmer,UMSLEEVE")(IF (AND (SETQ ss (SSGET "x" (LIST '(0 . "INSERT") (CONS 2 (STRCAT "`*U*" blst)) '(410 . "Model")))) (FOREACH i blklst (MAPCAR '(LAMBDA (x)(IF (NOT (EQ i (VLA-GET-EFFECTIVENAME (VLAX-ENAME->VLA-OBJECT (CADR x)))))(SSDEL (CADR x) ss) ) ) (SSNAMEX ss)) ) ) (WHILE (SETQ Ent (SSNAME ss 0)) (SETQ BlkName (CDR (ASSOC 2 (ENTGET Ent)))) (IF(SETQ tempList (ASSOC BlkName EndList)) (SETQ EndList (SUBST (CONS BlkName (1+ (CDR tempList))) tempList EndList))(SETQ EndList (CONS (CONS BlkName 1) EndList)) ) (SSDEL Ent ss) ))
The other code is long and I'd rather not confuse things; if I do not try to filter out any Unames, then everything works great and fast. Once I add in the "foreach i blklst" the code breaks and I get:
; error: null interface pointer: #<VLA-OBJECT 0000000000000000>
returned.
View 7 Replies
View Related
Jan 9, 2013
I try to use the SSGET function, and it returnes a string.
How to access the data?
Which function to use?
View 8 Replies
View Related
Jan 23, 2013
I wonder if I have to check if the "ssget" is empty.
I have a lisp to zoom extents in visible objects on the screen.
My interest is to filter before applying:If I have selected objects, it zooms in these objects. If I'm not have selected objects, continue as it is today, applying a zoom in the visible scene.
The result would be similar to a zoom of "3dsmax" (press the Z key)
The atual code
(defun c:ZOBJECTS(/ selectprev)(SETQ selectprev (SSGET "_P"))(command "._UCS" "View")(command "._zoom" "extents")(command ".__zoom" "object" "cross" "-1e99,-1e99" "1e99,1e99" "")(command "._UCS" "previous")(command "._select" selectprev ""))
View 6 Replies
View Related
May 22, 2013
Someday the light bulb is going off and I will understand mapcar and lambda. However.....I have a program that reads an excel file sheets. Sometimes the sheet only has 1 column, sometimes 2 or more.
I need to convert the saved values from the sheet to a list with the text spaced evenly. Unfortunately the text lengths vary. I would like a subroutine to pass the list to and return a list of strings with text aligned with padded spaces allowing for the longest text in each column. I am using the new list in a dialog box with fixed_width_font=true (so columns align).
Example 1-
(setq List1 (list "Col1-Line1" "Col1-Line2" "Col1-Line3-longer" "Col1-Line4"))
(AlignText List1)
returns
"Col1-Line1"
"Col1-Line2"
"Col1-Line3-longer"
"Col1-Line4"
so no padding needed
Example 2 -
(setq List2 (list (list "Col1-Line1" "Col1-Line2" "Col1-Line3-longer" "Col1-Line4") (list "Col2-Line1-longer" "Col2-Line2" "Col1-Line3" "Col2-Line4")))
(AlignText List1)
returns
"Col1-Line1 Col2-Line1-longer"
"Col1-Line2 Col2-Line2 "
"Col1-Line3-longer Col2-Line3 "
"Col1-Line4 Col2-Line4 "
Example 3 -
(setq List3 (list (list "Col1-Line1" "Col1-Line2-longer" "Col1-Line3" "Col1-Line4") (list "Col2-Line1-longer" "Col2-Line2" "Col1-Line3" "Col2-Line4") (list "Col3-Line1-longer" "Col3-Line2" "Col1-Line3" "Col3-Line4")))
returns
"Col1-Line1 Col2-Line1-longer Col3-Line1-longer"
"Col1-Line2-longer Col2-Line2 Col3-Line2 "
"Col1-Line3-longer Col2-Line3 Col1-Line3 "
"Col1-Line4 Col2-Line4 Col3-Line4 "
View 5 Replies
View Related
Jun 28, 2012
Is there any way to isolate an item in a list for a filter? I'm setting a filter for SSGET and know that I can use the dotted pairs and I know I can use logical comparisions but what I really want to do is filter a single varialbe in the DXF group 10. For example, I'd like to only get entities with a specific Z value in DXF 10. Or even better to filter for a specified range of Y value or X value in DXF 10. If I could write something like (cons 10 (list * * 8.0)) where the asterisks were wild cards, that would do it but I'm not aware of such a wildcard. Is there any way to isolate a portion of DXF 10 in the filter?
View 4 Replies
View Related
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
Nov 27, 2012
I have this code that I wrote years ago that I want to update to select two types of civil3d objects and show them selected with grips on the screen. This function works fine
(defun CELFEATURE ()
(ssget "_X" '((0 . "AECC_FEATURE_LINE")))
(setq sset (ssget "P"))
(if sset
(progn
(sssetfirst sset sset)
;(command "_.PROPERTIES")
)
)
)
(defun cF () (CELFEATURE))
but if I add the extra object like this which I assume is the wrong syntax i only get the second type of objects. Need correct syntax I should be using for selecting more than one object in an ssget statement.
(defun CELFEATURE ()
(ssget "_X" '((0 . "AECC_FEATURE_LINE","AECC_AUTO_CORRIDOR_FEATURE_LINE")))
(setq sset (ssget "P"))
(if sset
(progn
(sssetfirst sset sset)
;(command "_.PROPERTIES")
)
)
)
(defun cF () (CELFEATURE))
View 2 Replies
View Related
Feb 5, 2012
Distinctions between AutoLISP functions ssget and C# PromptSelectionOption method.AutoLISP ssget function is apply a function with no options and does not require an object selection.pre-selected target object should respond to the selection set.
However, and C# PromptSelectionOption, ignoring the pre-selected objects, select the new object is required.using the features of C# Prompt Selection Option expressed AutoLISP ssget do the same in,
View 1 Replies
View Related
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
Sep 19, 2011
If you do a LIST command on a dynamic block... AutoCAD tells you the Block Name as well as the Anonymous Block name.
How can I use ssget to snag all Dynamic Blocks that use the 'Real Block'?
View 3 Replies
View Related
Jul 18, 2013
I have subroutine that retrieves a list of detail numbers in a drawing. Sometimes there are missing numbers. I am looking to find a list of any missing numbers.
Example -
(setq List_DN (list 1 2 3 5 6 7 10 11 12 17))
Missing numbers are - 4,8,9,13,14,15,16
I would like a subroutine to take the List_DN are return the following missing numbers as text
(Get_Missing List_DN)
return
4,8-9,13-16
View 9 Replies
View Related
Jun 7, 2012
I would like to take all the vertices out of a multiple-vertices polyline so that it reduces to just its start and end points, can this be done?
View 4 Replies
View Related
Sep 21, 2013
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.
View 5 Replies
View Related
Jul 15, 2013
I have a list -
(setq List1 (list "Line A" "Line B" "Line C"))
I would like to add each item in an existing list to a new list -
(setq ListNew (list "This is some text" "This is more text"
the following is the part I can't figure out - it just adds the list to the list, not the individual items
(mapcar '(lambda (x) x) List1)))
I am looking for ListNew to be - (a list with 5 strings)
"This is some text"
"This is more text"
"Line A"
"Line B"
"Line C"
View 9 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
Apr 26, 2013
this is a Offset cutting plane line I want it to be all polylines but I can't get the ename of the end points of the polylines dose anyony know how
(defun ccp (/ pt2)
(SETVAR "CMDECHO" 0)
(setvar "angbase" 0)
(setvar "angdir" 0)
(command "polarang" 1)
(setq pt1 (getpoint "
[Code]....
View 9 Replies
View Related
May 21, 2012
Is it possible to determine the sum of the lengths of all of the polylines on a certain layer? I'm trying to determine the total length of joint sealant on a building's exterior.
View 8 Replies
View Related
Aug 23, 2012
I am using acad 2010. I have a contour generator that uses 3d polylines to make contours. I get depressions or tops where I don't want them. I need a lisp routine that will allow me to adjust the z value only on any 3d polyline. I need to raise or lower the z value at any vertex and repeat if necessary. I don't need to prompt the user- I am the user.
View 2 Replies
View Related
Jul 19, 2013
I create contour line in TOPOGRAPH program, and I import these polylines to AUTOCAD. I have to set elevation for each polyline manually, and I waste a lot of time doing that.
So looking for lisp doing that automatically. I mean, invoke the command, set the first elevation and them select the polylines.
e.g. The first elevation is 530. The next polyline that I select is 531 and so on.
View 3 Replies
View Related
Feb 17, 2009
For the sake of editing, I sometimes make LWPOLYLINES and convert them to regions so that I can union and subtract and intersect, etc.
then sometimes, like now, I want to work with them like as LWPOLYLINES again.
is there some command I don't know, or some routine or shall I make one?
View 8 Replies
View Related
Mar 7, 2012
is there a way to draw a polyline and have autocad clip everything outside of that polyline and discard it so that i end up with a smaller drawing. only the information in that polyline, nothing outside of the polyline
View 3 Replies
View Related
Feb 5, 2013
I've been searching on and off all morning for a lisp routine, without any luck. I'm trying to draw a pline with a pre determined width (5") and be able to draw unlimited line segments then automatically fillet with a pre determined radius (5").
I wrote this generic macro: ^C^CPLINEWID;5;PL;\\;FILLET;R;5;F;P;LAST; to save SOME time but I want unlimited line segments. Can this be modified or would a lisp be the better route to go?
View 3 Replies
View Related
May 4, 2011
Code below, for labeling polyline areas
It works great for what i want, with 2 exceptions the text is to small and the label is not inserted at the centroid of the polyline, rather it is placed outside the polyline.
i am able to increase the text style by adjusting the dimscale before i run the command, however it would be good if the program could do that automatically, i would like the text to be about 300 units high, and for the label to be placed at the centroid of the polyline
(defun C:AT ( / ss i)
View 9 Replies
View Related
Aug 1, 2012
do you know command or lisp that will do new pollyline between two polyline on 1/3 or 1/4 space between them.
I need sommething that would be faster,know is use measure on pollilines then i draw between horizontall polylines on verteks or point new pollyline and then divide it on 4 or 3 parts.
View 1 Replies
View Related
Apr 17, 2012
i.e. one that would apply best fit lines and arcs to a segmented polyline?
View 4 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
Apr 13, 2012
I´m looking for opportunities to can modify a polyline with 4 or more segments in a polyline with arc. I think it´s possible to pick start and end segment first and than all straight segments to will be in arc segments.
View 6 Replies
View Related