SSX Procedure as a Script not working.

SSX Procedure as a Script not working.

dlbsurveysuk
Collaborator Collaborator
1,369 Views
3 Replies
Message 1 of 4

SSX Procedure as a Script not working.

dlbsurveysuk
Collaborator
Collaborator

Hi, manually this works fine -

 

Command: SSX
Select object <None>:
Enter filter option [Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector]: ENTITY
>>Enter entity type to add <RETURN to remove>: POLYLINE
Current filter: ((0 . "POLYLINE"))
Enter filter option [Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector]:
196 found.
Command:
Command: EXPLODE
Select objects: PREVIOUS
196 found

 

 As a script -

 

SSX

ENTITY
POLYLINE

EXPLODE
PREVIOUS

 

it doesn't -

 

Command: _SCRIPT
Enter script file name <C:\Users\44792\Desktop\OckbrookTEST2.scr>: "C:\Users\44792\Desktop\Lisp\DXF-MODIFY-SCRIPT.scr"
Command: ssx
Select object <None>:
Enter filter option [Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector]: ENTITY
>>Enter entity type to add <RETURN to remove>: POLYLINE
Current filter: ((0 . "POLYLINE"))
Enter filter option [Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector]:
196 found.
Command:
Command: EXPLODE
Select object: PREVIOUS
*Invalid selection*
Expects a point or Last/ALL/Group

 

Does anyone know why? Am I missing something obvious?

Thanks.

0 Likes
Accepted solutions (1)
1,370 Views
3 Replies
Replies (3)
Message 2 of 4

cadffm
Consultant
Consultant
Accepted solution

Hi,

 

1. This has nothing to with ssx

2. Read about explode in your help[F1]

 

And for more Information:

By using an automation to controle native commands (script,macro,send command..),

Autocad starts

a) the commandline version of a command

  If it is a dialog window command, but the -commandline version is available

b) the old(est) command version

   Explode for example, as you can read in thw help doc, explodes obly one object in this older command version.

Also "previous" wasn't a valid objectselection(untested, just what i read in your post).

 

 

Solution: Start the current version of explode command,

Try this:

One line above EXPLODE, add (initcommandversion)

 

Note: This is a Lidpfunction, so this way is not useable for LT version

Sebastian

Message 3 of 4

dlbsurveysuk
Collaborator
Collaborator

Thank you, that works, and thanks also for the detailed reason why. I'm new to scripting so it's good to gain some understanding. Much to learn. Thanks again.

0 Likes
Message 4 of 4

Sea-Haven
Mentor
Mentor

Rather than a script you can load a lisp, in the case of the selection use (setq ss (ssget)) or with filters.

 

(Command "explode" ss "") will explode the selection set anything not explodable will be ignored.

 

Could even type on command line this (command "explode" (ssget '((0 . "LWPOLYLINE"))) )

0 Likes