Author Topic: 3rd party command definition  (Read 2963 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7529
3rd party command definition
« on: April 14, 2006, 05:04:57 PM »
How would I get lisp to recognize this command that is defined through 3rd party software?

Code: [Select]
(if (or (= (getvar 'lunits) 3) (= (getvar 'lunits) 4))
  (command "WID_SetDesignArcRadius" "5'")
  (command "WID_SetDesignArcRadius" "5")
)

If I paste "WID_SetDesignArcRadius" into the command line it is recognized....but in the lisp it is not?

Thanks,

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Serge J. Gianolla

  • Guest
Re: 3rd party command definition
« Reply #1 on: April 14, 2006, 05:28:48 PM »
(WID_SetDesignArcRadius "5'")

ronjonp

  • Needs a day job
  • Posts: 7529
Re: 3rd party command definition
« Reply #2 on: April 14, 2006, 05:31:36 PM »
Nice try but....

; error: no function definition: WID_SETDESIGNARCRADIUS

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: 3rd party command definition
« Reply #3 on: April 14, 2006, 05:42:31 PM »
You will probably be able to run it by:
 (C:WID_SETDESIGNARCRADIUS)
but you won't be able to pass the "5" to it......that's one limitation of lisp commands. If you can find if & where this value gets stored then you may have better luck modifying yourself.

Serge J. Gianolla

  • Guest
Re: 3rd party command definition
« Reply #4 on: April 14, 2006, 05:49:42 PM »
Nice try but....

; error: no function definition: WID_SETDESIGNARCRADIUS

This error means your function was not loaded.
And as Jeff started mentioning about argument passed to routine, check if you have similar:
(defun c:WID_SETDESIGNARCRADIUS (sVal / ....)
« Last Edit: April 14, 2006, 05:53:33 PM by Serge J. Gianolla »

ronjonp

  • Needs a day job
  • Posts: 7529
Re: 3rd party command definition
« Reply #5 on: April 14, 2006, 07:16:31 PM »
Thanks for the ideas guys....I figured it out. I guess the progem is written in visualbasic so....

(command "-vbarun" "WID_Dispatch.SetDesignArcRadius" "5'")

works from lisp :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

FengK

  • Guest
Re: 3rd party command definition
« Reply #6 on: April 15, 2006, 04:01:32 AM »
How would I get lisp to recognize this command that is defined

Ron

How about

(command "VBASTMT" "ThisDrawing.SendCommand \"WID_SetDesignArcRadius\"")

Andrea

  • Water Moccasin
  • Posts: 2372
Re: 3rd party command definition
« Reply #7 on: April 15, 2006, 03:20:56 PM »
Maybe not a good help...but..

Code: [Select]
(if (or (= (getvar 'lunits) 3) (= (getvar 'lunits) 4))
  (setq val1 "5'")
  (setq val1 "5")
)
(vl-cmdf "WID_SetDesignArcRadius" val1)

;;also you can try this...
(setq val1 (strcat "5" (chr 39)))

;;or this...
(vl-cmdf "WID_SetDesignArcRadius" "!val1")
Keep smile...