Mark,
My advice would be to deal with binding the xrefs first, then you can do
something like this:
(if (ssget "x" '((0 . "viewport")))
(command ".-aecobjexplode" "Y" "C" "Y" "Y" "Y" "N" "N")
(command ".-aecobjexplode" "Y" "Y" "Y" "Y" "N" "N")
)
This is what I do. I say Yes to Explode to anonymous, so you will need to
modify the above to suit. I don't ever get the Continue prompt, so it's not
answered in my code. If you still do get it sometimes, you could follow the
above with:
(if (> (getvar "cmdactive") 0) (command "Y"))
and then
(while (> (getvar "cmdactive") 0) (command ""))
to answer anything else (though I can't imagine what).
HTH
Ken Krupa
Autodesk Authorized Developer
Krupa CADD Solutions
www.krupacadd.com
KCS Productivity Pack for AEC
KCS Productivity Pack for AutoCAD
"Mark Ingram" wrote in message
news:5683530@discussion.autodesk.com...
Hi Jason / Tom
In this case Aecobjexplode (ADT4/6/AA08) has different prompt sequence
depending on the type of objects that are in the drawing, and I can test
accurately about 80% of the time which isn't good enough, and causes the
function to fail. I'm using the function in a script processing large groups
of drawings, so if the function fails, the script fails and causes a real
mess.
In the code below, I am able to test for the error successfully, but the
error prompt is still returned causing the script to fail. The function will
finish correctly as the error is caught, but the script bombs due to the
error still throwing the error message to the command prompt.
I've tried vl-cmdf, but it also still echoes the "invalid input" to the
command prompt.
Here's the core issue = this function works by itself, but I need to make
the error trap silent - no command error being echoed to the command prompt.
The vl-error object isn't the issue, it's the command echo. Is there a way
to "wrap" the vl-catch-all-apply to silence the command error echo?
Thanks for your time,
Mark
(and
(if
(vl-catch-all-apply '(lambda () (apply 'command
(list ".-aecobjexplode"
"y" ;..explode to primitive
"c" ;..Views to explode [Current/All]:
"y" ;..Re-use existing names for Layers and Block Definitions?
[Yes/No]
"n" ;..Bind Xrefs?
"n" ;..Explode to anonymous blocks? (if yes, aec objects become
anon blocks)
"y" ;..Maintain Resolved Layer, Color, and Linetype?
"y" ;..Erase AEC objects?
"n" ;..Use short symbol names?
"n" ;..Display status messages?
"y" ;..You should either Bind these Xrefs first or run...
continue?
)
)))
(progn (command)(command) t) ;..t keeps AND going
)
(if
(vl-catch-all-apply '(lambda () (apply 'command
(list ".-aecobjexplode"
"y" ;..explode to primitive
"n" ;..Bind Xrefs?
"n" ;..Explode to anonymous blocks? (if yes, aec objects become
anon blocks)
"y" ;..Maintain Resolved Layer, Color, and Linetype?
"y" ;..Erase AEC objects?
"n" ;..Use short symbol names?
"n" ;..Display status messages?
"y" ;..continue?
)
)))
(progn (command) (command) t) ;..t keeps AND going
)
)