Hi all
I would like to trap errors while using the "offset" command, but I
think I don't understand how vl-catch-all-apply works. I use this:
(vl-catch-all-apply 'command (list "_offset" offset_value
entitie_to_offset side ""))
I want to know if the command worked or if the entitie can't be
offseted.
I've read past discussions about this, but still don't understand...can
anyone help ?
Thanks
Philippe
I don't know if there's anything different while using "command"(i've only
used it with functions)
but my understanding of the general way to use vl-catch is as follows:
set a variable to the return value of catch-all-apply
(setq thisVar (vl-catch-all-apply 'your attempted function ))
then check the variable to see if it's an error object
(if (vl-catch-all-error-p thisVar)
; if it's an error, do something, maybe priint the error msg?
(princ "Exception: " (vl-catch-all-error-message thisVar))
;else it's not an error so do something else
...whatever
);end if
hth
Mark
Instead try studying up on the various ActiveX methods that are similar in
functionality to AutoCAD commands. In this case it would be the Offset method.
Make yourself a shortcut to the acad_dev.chm help file.
--
John Uhden, Cadlantic/formerly CADvantage
http://www.cadlantic.com
Sea Girt, NJ
"Philippe" <eas...@free.fr> wrote in message news:3E621311...@free.fr...
John Uhden a écrit :
--
Delicad - Sharewares et Freewares en français pour AutoCAD.
http://easycad.free.fr
Tested:
(vl-catch-all-apply '(lambda () (command "_.ARC" "" pause)))
--
________________________________________________
Marc'Antonio Alessi (TV) Italy - maal...@tin.it
(strcat "NOT a " (substr (ver) (if (= 15
(atoi (getvar "acadver"))) 8 5) 4) " guru.")
O.S. = XP Pro 2002 - Sp.1 - Ita
AutoCAD = 2002 Ita - Sp.1
_VERNUM = "K.0.44"
ACADVER = "15.06s (LMS Tech)"
(ver) = "Visual LISP 2000 (it)"
________________________________________________
"Philippe" <eas...@free.fr> ha scritto nel messaggio
news:3E621311...@free.fr...
Marc'Antonio Alessi a écrit :
--
Philippe wrote:
>
> Hi all
> I would like to trap errors while using the "offset" command, but I
> think I don't understand how vl-catch-all-apply works. I use this:
> (vl-catch-all-apply 'command (list "_offset" offset_value
> entitie_to_offset side ""))
> I want to know if the command worked or if the entitie can't be
> offseted.
Et pourquoi tu passes pas par :
(if (vlax-method-applicable-p (vlax-ename->vla-object
entitie_to_offset)'Offset)
(vlax-invoke-method (vlax-ename->vla-object entitie_to_offset)
'Offset unpoint))
pour tester si l'objet et offsettable. A moins que tu veuille surveiller
les appels à Offset??
Richard
Richard Paupy a écrit :
--
Richard Paupy a écrit :
Philippe a écrit :
Philippe wrote:
> Impeccable, le seul truc qui me gêne...c'est de ne pas y avoir pensé tout seul..
Tout seul, pas d'humanité possible....;-)
> Merci
You're welcome.
> Philippe
>
>
Generally, you would have to capture (entlast) before
and after the call to (command), and compare them using
the (eq) function to see if the offset succeeded or not.
"Philippe" <eas...@free.fr> wrote in message news:3E6358FA...@free.fr...