INITCOMMANDVERSION RETURNING ERROR IN LISP

I've got a LISP that explodes all 3d polylines in ACAD:

(defun c:3DEXPLODE (/ pl)
(setq pl (ssget "X" '((0 . "*POLYLINE"))))
(initcommandversion 2)
(command "_explode" pl "")
)

originally sourced from leemac

but when I run it in Bricscad it tells me it doesn't recognise "initcommandversion".

is there a way to easily hack this LISP up for BricsCAD? Or a different LISP I can use to do the same thing, select all *polylines and explode them into lines?

TY

Comments

  • First, your SSGET command will get all polylines, not just 3Dpolylines. Gile suggested this syntax to get just 3Dpolylines:

    (setq pl (ssget "_X" '((0 ."POLYLINE") (-4 . "&") (70 . 8))))

    As to INITCOMMANDVERSION, I would comment the line out.
  • I need the * so that it gets both 3dpolylines and polylines. While drafting the survey imports come in as 3d polylines and there are elements introduced during the drafting process that are generated as polylines.

    I understand that in CAD the initcommandversion sets the command line entry, in this case to 2 "manual entry", I may be paraphrasing the command.

    I tried the LISP without (initcommandversion 2) and changed (command "_explode" pl "") to (command "explode" pl "") but to no avail.
  • Try:
    (defun c:3DEXPLODE (/ pl)
    (setq pl (ssget "X" '((0 . "*POLYLINE"))))
    (command "_explode" pl)
    (princ)
    )