Author Topic: Custom Cursor  (Read 4712 times)

0 Members and 1 Guest are viewing this topic.

Zibnaf

  • Guest
Custom Cursor
« on: April 18, 2006, 03:48:42 PM »
Hi,

I've been looking to make a custom cursor for autocad.  A program that will put a block overtop of the crosshair would be best.

I have read all of the related posts on this site about the topic, but have not been able to piece it together into something that will work for me.  From what I understand about it, VBA and LISP do not appear to be able to accomplish a custom crosshair.  I was close with LISP but could not use any AutoCAD commands while the lisp was running.

From what I have read, .net or arx may be able to do it, but I don't know enough about them to create the code for it.

If you guys had any ideas that would be a great help.

Thanks,

Ed

CAB

  • Global Moderator
  • Seagull
  • Posts: 10369
Re: Custom Cursor
« Reply #1 on: April 18, 2006, 04:59:51 PM »
Welcome to the swamp Ed. :-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MickD

  • Gator
  • Posts: 3314
  • (x-in)->[process]->(y-out)
Re: Custom Cursor
« Reply #2 on: April 18, 2006, 05:46:48 PM »
Hi Ed,
I think this would be more likely a windows issue. As I understand it you can change the cursor to any of the autocad defined types but a custom one or something to follow over or beside the std cursor would involve messing with the current cursor through the windows api.
The other problem (as you pointed out with using lisp) would be the messaging with autocad from the mouse movements etc.
You probably could probably do this with vba but C#/vb.net would probably be easier.

If you want to start fleshing something out to look at we could probably help, good luck.

Cheers,
Mick.
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

CAB

  • Global Moderator
  • Seagull
  • Posts: 10369
Re: Custom Cursor
« Reply #3 on: April 18, 2006, 06:01:20 PM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Zibnaf

  • Guest
Re: Custom Cursor
« Reply #4 on: April 19, 2006, 10:48:56 AM »
Have a look here
http://www.theswamp.org/index.php?topic=9216.0

I talked to rajat_mallick and read up on the related links.  Those appear to refer to changing the windows cursor.  I am looking more to have a block follow the cursor while I work in AutoCAD.

I will solve this one eventually.

Ed

CADaver

  • Guest
Re: Custom Cursor
« Reply #5 on: April 19, 2006, 11:25:43 AM »
Have a look here
http://www.theswamp.org/index.php?topic=9216.0

I talked to rajat_mallick and read up on the related links.  Those appear to refer to changing the windows cursor.  I am looking more to have a block follow the cursor while I work in AutoCAD.

I will solve this one eventually.

Ed
I'm confused again, other than visually appealing, what are you trying to accomplish??

Zibnaf

  • Guest
Re: Custom Cursor
« Reply #6 on: April 19, 2006, 11:58:46 AM »
Have a look here
http://www.theswamp.org/index.php?topic=9216.0

I talked to rajat_mallick and read up on the related links.  Those appear to refer to changing the windows cursor.  I am looking more to have a block follow the cursor while I work in AutoCAD.

I will solve this one eventually.

Ed
I'm confused again, other than visually appealing, what are you trying to accomplish??

Visual aid is exactly the purpose.
By having a block follow the crosshair, you have a scaleable crosshair. 
A scaleable crosshair was a huge benifit in MineSite (mine design program), allowing for much greater speed in understanding of topographic features, designing pit ramps, and minimum widths for equipment to operate on, etc.

Working for a consulting company on a new clients project.  The client does not have Minesite and has requested the majority work to be completed in AutoCAD.

Everyone in the office has noted the issue and have assigned me the task of solving it.

Ed

MP

  • Seagull
  • Posts: 17488
Re: Custom Cursor
« Reply #7 on: April 19, 2006, 12:04:11 PM »
Perhaps use the prescale option of the insert command.

-insert <enter> blockname <enter> ps [enter] 2.5 <enter> ...

In the above 2.5 would be the prescale value. Now AutoCAD will ghost an image of the block 2.5 times normal.

Edit: fixed typo.
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

CADaver

  • Guest
Re: Custom Cursor
« Reply #8 on: April 19, 2006, 02:26:54 PM »
Visual aid is exactly the purpose.
By having a block follow the crosshair, you have a scaleable crosshair. 
If you're looking for an accurately measured representation of something to continuously follow the crosshair and re-scale on subsequent zooming, I think you'll be disappointed.

However as Michael pointed out, at insertion, blocks can be pre-scaled prior to placement.  Making a block from a a rectangle that is 1 unit square, will allow you to pre-set the X and Y scales before placing.  Then you can "drag" it around the screen for a visual aid to clearances and such and cancel the command when finished.  At anytime while "dragging", you can enter XS or YS to adjust the scales as desired, or R to preset the rotation of the block.

Alexander Rivilis

  • Bull Frog
  • Posts: 212
  • Programmer from Kyiv (Ukraine)
Re: Custom Cursor
« Reply #9 on: April 21, 2006, 03:27:10 PM »

Zibnaf

  • Guest
Re: Custom Cursor
« Reply #10 on: April 21, 2006, 05:24:45 PM »
What about this solution: http://www.theswamp.org/index.php?topic=9133.0

I tried changing the code in the test function and call back function and got something that nearly worked.  I could not get the program to run in the background, so I could use other autocad commands while having the custom cursor.


I have been looking into writing a arx/.net program that would update a block's properties (location) to the crosshair coordinates with a windows timer event. So that it updated something like 20 times a second or something.

Do you think this would work and allow me to use autoCAD commands at the same time?

Ed

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1542
  • Moscow (Russia)
Re: Custom Cursor
« Reply #11 on: April 22, 2006, 01:40:21 AM »
I already use this program in the project!
I add dimensional frameworks (round or rectangular), for the indication of a point or a direction... :-)
蝸牛そろそろ登れ富士の山 /Kobayashi Issa/

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Custom Cursor
« Reply #12 on: May 16, 2006, 05:07:31 PM »
Perhaps use the prescale option of the insert command.

-insert <enter> blockname <enter> ps [enter] 2.5 <enter> ...

In the above 2.5 would be the prescale value. Now AutoCAD will ghost an image of the block 2.5 times normal.

Edit: fixed typo.


A belated thank you .... not for reminding me, cause I don't know if I ever knew this ..
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--