ObjectARX

ObjectARX

Reply
Contributor
renencon
Posts: 25
Registered: ‎02-08-2012
Message 1 of 5 (182 Views)

Grip Colors and AcDbGripData::setWorldDraw

182 Views, 4 Replies
11-19-2012 07:40 AM

Hi,

 

Within the callback function set by AcDbGripData::setWorldDraw you can draw the glyph for a custom grip.

 

If you do not set colors the default grip colors set at the AutoCAD's options dialog are used except GRIPCONTOUR color.

 

For example lets say I draw a small filled rectangle for the grip. I first use

pWd->subEntityTraits().setFillType(kAcGiFillAlways); to enable filled graphics and then I draw a polygon geometry using pWd->geometry().polygon(4,pts); however the resulting grip that way is filled with that grip color from the options dialog and the same color is used for its boundary line as well.

 

How can you use GRIPCONTOUR color for the boundary line of the grip?

 

Thanks

Anastassios

 

 

 

 

Valued Contributor
NikolayPoleshchuk
Posts: 60
Registered: ‎06-27-2006
Message 2 of 5 (167 Views)

Re: Grip Colors and AcDbGripData::setWorldDraw

11-19-2012 10:30 PM in reply to: renencon

Draw the boundary line once more with polyline method after filling.

Nikolay Poleshchuk
http://poleshchuk.spb.ru/cad/eng.html
Contributor
renencon
Posts: 25
Registered: ‎02-08-2012
Message 3 of 5 (162 Views)

Re: Grip Colors and AcDbGripData::setWorldDraw

11-20-2012 02:02 AM in reply to: NikolayPoleshchuk

Not possible the polyline will also be drawn with GRIPCOLOR not GRIPCONTOUR.

You need access to the value of GRIPCONTOUR set it with pWd->subEntityTraits().setColor(GRIPCONTOUR VALUE); and then draw the polyline or polygon as you suggested a second time.

But how do you get access to the GRIPCONTOUR value from within worlddraw callback function?

 

Thanks

Anastassios

Valued Contributor
NikolayPoleshchuk
Posts: 60
Registered: ‎06-27-2006
Message 4 of 5 (149 Views)

Re: Grip Colors and AcDbGripData::setWorldDraw

11-20-2012 09:45 PM in reply to: renencon

Yes, you must set color and other properties before using polyline method.

I do not use GRIPCONTOUR color, I draw with my own value. You can prepare the value of GRIPCONTOUR system variable beforehand and store it in some global variable if acedGetVar is impossible inside grip callback function.

Nikolay Poleshchuk
http://poleshchuk.spb.ru/cad/eng.html
Distinguished Contributor
maisoui
Posts: 131
Registered: ‎12-07-2009
Message 5 of 5 (143 Views)

Re: Grip Colors and AcDbGripData::setWorldDraw

11-21-2012 02:38 AM in reply to: NikolayPoleshchuk

Hi,

 

Interesting post. Maybe, this will help (list of vars for grips colors with default values) :

 

acad_grips_color.png

 

Regards,

Jonathan

 

--
Jonathan
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.