TheSwamp

Code Red => .NET => Topic started by: Zibnaf on April 18, 2006, 03:48:42 PM

Title: Custom Cursor
Post by: Zibnaf 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
Title: Re: Custom Cursor
Post by: CAB on April 18, 2006, 04:59:51 PM
Welcome to the swamp Ed. :-)
Title: Re: Custom Cursor
Post by: MickD 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.
Title: Re: Custom Cursor
Post by: CAB on April 18, 2006, 06:01:20 PM
Have a look here
http://www.theswamp.org/index.php?topic=9216.0
Title: Re: Custom Cursor
Post by: Zibnaf 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
Title: Re: Custom Cursor
Post by: CADaver 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??
Title: Re: Custom Cursor
Post by: Zibnaf 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
Title: Re: Custom Cursor
Post by: MP 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.
Title: Re: Custom Cursor
Post by: CADaver 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.
Title: Re: Custom Cursor
Post by: Alexander Rivilis on April 21, 2006, 03:27:10 PM
What about this solution: http://www.theswamp.org/index.php?topic=9133.0
Title: Re: Custom Cursor
Post by: Zibnaf 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
Title: Re: Custom Cursor
Post by: ElpanovEvgeniy 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... :-)
Title: Re: Custom Cursor
Post by: Kerry 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 ..