TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: XXL66 on October 20, 2015, 09:18:20 AM
-
hello,
i want to convert LWPOLYLINES and use the PEDIT command to turn them into curve fitted or spline poly's
using (command "_pedit" (list e pt) "_S" "_X") and (command "_pedit" (list e pt) "_F" "_X")
however this does not seem to work consistently. Sometimes is works sometimes it doesn't and i cannot seem to find out why...
I get "Unable to recognize entry. Please try again." This is in BCAD. However trying manually (reconstructing lisp entry) it seems to works fine...
Is there any other simple method for converting these polylines other then using PEDIT ?
ty !
-
For the command call to work I think the pt value must be a point on the entity.
Alternative approach:
Convert the polyline to a heavy polyline and change the type property.
Code for converting a polyline can be found here:
http://www.bricsys.com/common/support/forumthread.jsp?id=15124
There is also a _CONVERTPOLY command that can be used.
-
thx Roy,
unfortunally your suggestion does not help. I know it needs a pt on th entity, and this is the case.
it does a few lwpl's and then it stops and the wierd thing is that the last polyline has become "line" segments, no exploding is involved, just a loop for all LWPL's and PEDIT them...
-
If you execute it manually with pedit multiple select it also does not work correctly. In ACAD this works fine. I filed a support request at Bricsys.
-
... the wierd thing is that the last polyline has become "line" segments, no exploding is involved, just a loop for all LWPL's and PEDIT them...
I have yet to test your code in a loop. But the "_X" option may be the cause of the exploding you see.
-
After doing some more research I find that the problem occurs when you try to use the "_SPLINE" option on an LW polyline with only two vertices. I do not get this error with the "_FIT" option.
If your tests confirm this, it may be wise to add this information to your SR.
)
(setq *out
* enme
) ; Store enme as global variable. )
)
)
)
)
(setq ss
(ssget '
((0 .
"LWPOLYLINE") (-4 .
">") (90 .
2)))) )
)
)
)
(defun c:TestFixAlt
( / ss
) (command "_.convertpoly" "_heavy" ss
"") (vla
-put
-type obj accubicsplinepoly
) )
)
)
)
Test with PEDIT, the "_MULTIPLE" option and two LW polylines with 2 vertices:
: pe
Multiple/Select polyline to edit: m
Select entities:
Opposite Corner:
Entities in set: 2
Select entities:
Edit polyline: Close/Open/Decurve/Fit/Join/Linetype-mode/Reverse/Spline/Taper/Width/Undo/<eXit>: s
Object of class AcDb2dPolyline can't be cast to AcDbPolyline.
-
Thx Roy,
indeed it has to do with 2 vertex polylines only. They are aware of the problem and also suggested the work-around with convertpoly.
thanks again !