Author Topic: Code in Vanilla not working in mechanical  (Read 1595 times)

0 Members and 1 Guest are viewing this topic.

Luke

  • Guest
Code in Vanilla not working in mechanical
« on: June 13, 2008, 10:09:04 AM »
I have the following code deep in a script...
Code: [Select]
(command "._explode" (entlast))
It works fin in full version vanilla 2006 but when I try to run it on our mechanical users machines it chokes and doesn't understand.

can anybody propose any alterntatives.


Joe Burke

  • Guest
Re: Code in Vanilla not working in mechanical
« Reply #1 on: June 13, 2008, 10:16:51 AM »
If there is an error message, what does it say?

Luke

  • Guest
Re: Code in Vanilla not working in mechanical
« Reply #2 on: June 13, 2008, 10:18:59 AM »
It just tells me -nil but it happens right after that line so I'm able to identify that as the problem line.

Joe Burke

  • Guest
Re: Code in Vanilla not working in mechanical
« Reply #3 on: June 13, 2008, 10:48:27 AM »
What does (entlast) return?

Luke

  • Guest
Re: Code in Vanilla not working in mechanical
« Reply #4 on: June 13, 2008, 10:53:19 AM »
it tells it to explode the last object inserted.

I think I figure it out though, I just put an * in front of the block I want exploded.  The * exploded it on insert

Crank

  • Water Moccasin
  • Posts: 1503
Re: Code in Vanilla not working in mechanical
« Reply #5 on: June 13, 2008, 01:29:45 PM »
Some commands are different between verticals or versions of Autocad.

When certain commands (for example EXPLODE) are issued last in the Lisp routine, they may not behave as in a previous version.  The workaround is to add (initcommandversion 2) before the command is called.  Example:
Code: [Select]
(setq ss (ssget))
(sssetfirst ss ss)
(initcommandversion 2)
(command "_.explode")
Vault Professional 2023     +     AEC Collection