Over 1.113.000 registered users (EN+CZ).
AutoCAD tips, Inventor tips, Revit tips, Civil tips, Fusion tips.
The new Beam calculator, Spirograph generator and Regression curves in the Converters section.
Discussion forum
?CAD discussions, advices, exchange of experience
CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.
Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
|
Post Reply
|
| Author | ||||||
marian1autocad
Newbie
Joined: 30.Oct.2014 Location: Romania Using: Autocad2014 Status: Offline Points: 5 |
Topic: Explode only polylinePosted: 06.Feb.2015 at 19:38 |
|||||
|
Hi everyoane,
I have a drawing in Autocad that contains lines, text, block reference, mtext and polylines. In this drawing with Autolisp i want to do next: 1. select all polylines 2. explode them I made, and i run this in Autocad but it doesn't work: (setq pl (ssget "X" '((0 . "LWPOLYLINE")))) (command "explode" pl) What is wrong in my syntax? How can i select all polylines from a drawing, and than to explode them? Any help is appreciated. Thank you very much! |
||||||
![]() |
||||||
Kent Cooper
Senior Member
Joined: 12.Mar.2013 Location: United States Using: AutoCAD2020, 2023 Status: Offline Points: 687 |
Posted: 06.Feb.2015 at 19:54 |
|||||
|
For some reason I've never seen explained, the Explode command in particular cannot Explode more than one thing at a time in a (command) function. There are at least two things you can do: 1) Step through the selection set and Explode each one individually, or 2) Mess around with the mysterious and undocumented QAFLAGS System Variable. If you Search for QAFLAGS in the AutoDesk Customization Forum, http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bd-p/130, you'll find various threads that talk about it and show you how to change the setting [and be sure to change it back!].
|
||||||
![]() |
||||||
marian1autocad
Newbie
Joined: 30.Oct.2014 Location: Romania Using: Autocad2014 Status: Offline Points: 5 |
Posted: 06.Feb.2015 at 21:08 |
|||||
|
I will search for QAFLAGS in the AutoDesk Customization Forum and i will see what advantage can bring.
![]() Thank you Kent Cooper for your help and for your time spent here for my probleme! I appreciate. |
||||||
![]() |
||||||
criecky
Newbie
Joined: 02.Jun.2013 Location: Germany Using: acad 2011 - 2015 Status: Offline Points: 1 |
Posted: 08.Feb.2015 at 09:49 |
|||||
|
hi, use
(defun c:polyexplo (/ pl) (setq pl (ssget "X" '((0 . "POLYLINE")))) (command "_explode" pl) ) |
||||||
![]() |
||||||
marian1autocad
Newbie
Joined: 30.Oct.2014 Location: Romania Using: Autocad2014 Status: Offline Points: 5 |
Posted: 08.Feb.2015 at 20:47 |
|||||
I tried your proposal and it did not work. Thank you Criecky! Any suggestion are welcom. |
||||||
![]() |
||||||
marian1autocad
Newbie
Joined: 30.Oct.2014 Location: Romania Using: Autocad2014 Status: Offline Points: 5 |
Posted: 08.Feb.2015 at 21:37 |
|||||
Kent Cooper gave me the solution for my problem, and i want to thank him very much. I set QAFLAGS variable to 1 (0 is default value) and after that my syntax works well. ![]() My syntax now will be: (setq a (getvar "qaflags")) (setq b (setvar "qaflags" 1)) (setq pl (ssget "X" '((0 . "LWPOLYLINE")))) (command "explode" pl "") (setvar "qaflags" a) Here ( http://www.manusoft.com/resources/acadexposed/sysvars.html ) i found this:
My problem is now solved and this topic should be closed! Thank you Kent Cooper for your help! ![]() |
||||||
![]() |
||||||
Vladimir Michl
Moderator Group
Arkance Systems CZ Joined: 26.Jul.2007 Location: Czech Republic Using: Autodesk software Status: Offline Points: 2165 |
Posted: 08.Feb.2015 at 22:25 |
|||||
|
But this is the official way to do that:
|
||||||
|
Vladimir Michl (moderator)
ARKANCE - https://arkance.world - Autodesk Platinum Partner |
||||||
![]() |
||||||
Kent Cooper
Senior Member
Joined: 12.Mar.2013 Location: United States Using: AutoCAD2020, 2023 Status: Offline Points: 687 |
Posted: 09.Feb.2015 at 15:47 |
|||||
... if you have a new-enough version of AutoCAD [I'm not sure in which version that was introduced]. Is the 2 there calling for a newer version of Explode that, inside a (command) function, can work with a selection set of more than one object? If so, that would also require a new-enough version of AutoCAD. Edited by Kent Cooper - 09.Feb.2015 at 15:52 |
||||||
![]() |
||||||
Kent Cooper
Senior Member
Joined: 12.Mar.2013 Location: United States Using: AutoCAD2020, 2023 Status: Offline Points: 687 |
Posted: 09.Feb.2015 at 15:51 |
|||||
The reason that doesn't work is that the only difference from the code in the first Post [other than the (defun) wrapping] is the entity type in the selection-set filter. It will find "heavy" 2D Polylines and 3D Polylines, but not LightWeight Polylines, and it will have the same problem with the Explode command and a multiple-object selection set.
|
||||||
![]() |
||||||
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
This page was generated in 0,101 seconds.
![CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]](/common/arkance_186.png)


Explode only polyline
Topic Options



criecky wrote:
