worldDraw() question

worldDraw() question

alex_b
Advocate Advocate
635 Views
6 Replies
Message 1 of 7

worldDraw() question

alex_b
Advocate
Advocate
Hi



I have a few questions regarding worldDraw():



1. please consider:



class A : public AcDbEntity { };//custom class

class B : public AcDbEntity { };//custom class



class C : public AcDbEntity {

A a;

B b;

public: double f;

}



Does acad call a.worldDraw() or does C::worldDraw() have to (optionally) do it? The same question for dwgIn/OutFields().

Does b.worldDraw() have access to f?



2. To display a hatch inside a.worldDraw(), is there a hatch() function callable from there, or do I have to embed an AcDbHatch object inside my custom object?



Thanks



alex
0 Likes
636 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
AutoCAD knows nothing about private members of
your custom object's class, so the worldDraw() of
those instances will not be called. You would have
to do it explicitly the worldDraw() of the containing
database-resident entity.

AFAIK, there's no hatch() function that draws hatching
geometry, so you would either have to calculate the
hatch geometry yourself, or create and use a hatch
entity in your worldDraw().

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


wrote in message news:[email protected]...
Hi



I have a few questions regarding worldDraw():



1. please consider:



class A : public AcDbEntity { };//custom class

class B : public AcDbEntity { };//custom class



class C : public AcDbEntity {

A a;

B b;

public: double f;

}



Does acad call a.worldDraw() or does C::worldDraw() have to (optionally) do
it? The same question for dwgIn/OutFields().

Does b.worldDraw() have access to f?



2. To display a hatch inside a.worldDraw(), is there a hatch() function
callable from there, or do I have to embed an AcDbHatch object inside my
custom object?



Thanks



alex
0 Likes
Message 3 of 7

alex_b
Advocate
Advocate
Thanks, Tony.



>>The same question for dwgIn/OutFields().

The same answer?



>>Does b.worldDraw() have access to f?

Its not really OARX, but I can't figure it out.



>AFAIK...

I meant solid hatch. I can't calculate it, and embedding a hatch object just to access its worldDraw() seems inefficient to me.



alex
0 Likes
Message 4 of 7

Anonymous
Not applicable
Yes, same answer.

AutoCAD does not know anything about custom objects
that are not database-resident, so don't expect it to call
any of there members.

>>Does b.worldDraw() have access to f?

No.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


wrote in message news:[email protected]...
Thanks, Tony.



>>The same question for dwgIn/OutFields().

The same answer?



>>Does b.worldDraw() have access to f?

Its not really OARX, but I can't figure it out.



>AFAIK...

I meant solid hatch. I can't calculate it, and embedding a hatch object just
to access its worldDraw() seems inefficient to me.



alex
0 Likes
Message 5 of 7

alex_b
Advocate
Advocate




OK.



One more question: can a custom object 'know' the reason its worldDraw() method was called?

I mean w/o resorting to checking the current command.



Thanks



alex



0 Likes
Message 6 of 7

Anonymous
Not applicable
Look at the context() member of the parameter to worldDraw(),
and the AcGiContext type it returns.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


wrote in message news:[email protected]...



OK.



One more question: can a custom object 'know' the reason its worldDraw()
method was called?

I mean w/o resorting to checking the current command.



Thanks



alex
0 Likes
Message 7 of 7

alex_b
Advocate
Advocate
Tony:

Context(() worked for me.

Thanks

alex
0 Likes