TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: rajat_mallick on March 23, 2006, 11:14:57 AM
-
Hi !
Is it possible to use "custom cursor" in AutoCAD through Visual Lisp ??
-Rajat Mallick :lmao:
-
I don't know about through VisualLisp, although there are some external applications that can do it, as I have seen some where the cursor was changed.
I have tried to duplicate it with an external application but the way AutoCAD deals with the crosshairs, you would need to have some serious event trapping and that makes it a bit more difficult than I really cared bother with ... after all, it wasn't really that important to me ....
-
Welcome to the Swamp.
You may get some ideas from this cool routine.
http://www.theswamp.org/index.php?topic=9133.0
-
Depends what you are after! DOSLib from www.mcneel.com has a function to change cursor to hourglass.
They actually have announced the release of DOSLib for AutoCAD 2007, today.
-
I tried like crazy with this AcitveX component, but I could never get it to work:
http://www.jcomsoft.com/anicur.htm
Here is the not-working code:
(Defun C:test ()
(VL-Load-Com )
(VLAX-Import-Type-Library
:TLB-Filename "C:/Documents and Settings/Zoltan/My Documents/Projects/AniCursor/AniCur.ocx"
:Methods-Prefix "ani-"
:Properties-Prefix "ani-"
:Constants-Prefix "ani-"
) ;;Import AniCursor type library
(VLAX-Import-Type-Library
:TLB-Filename "C:/Documents and Settings/Zoltan/My Documents/Projects/AniCursor/hWnd.ocx"
:Methods-Prefix "wnd-"
:Properties-Prefix "wnd-"
:Constants-Prefix "wnd-"
) ;;Import hWnd type library
(SetQ aniAppObj (VLAX-Get-or-Create-Object "AniCursor.AniCursor") ) ;;Get AniCursor application object
(SetQ wndAppObj (VLAX-Get-or-Create-Object "hWndCtrl.hWndCtrl") ) ;;Get hWnd application object
(GetString ) ;;pause after that stupid registration dialog, and regain focus
(SetQ DocWndHnd (VLA-Get-HWND (VLA-Get-ActiveDocument (VLAX-Get-Acad-Object))) ) ;;Get window handle of active document
(SetQ AcadWndHnd (wnd-GetParent wndAppObj DocWndHnd) ) ;;get the handle of the parent
(SetQ SomeWndHnd (wnd-GetParent wndAppObj AcadWndHnd) ) ;;get the handle of..umm..someother parent
(ani-ReadAni aniAppObj "C:/Program Files/MDT6/desktop/support/lmcycle.ani" ) ;;steal cursor from MDT
(VLAX-Put-Property aniAppObj 'hWnd SomeWndHnd ) ;;set the animation cursor application's hWnd to AutoCad's
(ani-StartAniCursor aniAppObj ) ;;start the animating cursor
(GetString) ;;pause
)
Sorry, I am of no help.