Custom Entity - inherit

Custom Entity - inherit

Anonymous
Not applicable
821 Views
7 Replies
Message 1 of 8

Custom Entity - inherit

Anonymous
Not applicable

hello,

My custom object should use  both line and arc method, how can I inherit my custom object?Inherit from AcDbCurve?I think it's not a good idea.

0 Likes
822 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable

Dear wh...,

 

if you create an (complex ?) Entity  that need both Arc's and Line'e you should derive from AcDbEntity. But it's more work.

0 Likes
Message 3 of 8

Anonymous
Not applicable

hello TomBengsch,

You said inherited from AcDbEntity? Why not AcDbCurve? I think it's better from AcDbCurve anyway.Now I used a basic class axis(axis is the object I wanted), axis line and axis arc used multiple inheritance, from axis and AcDbLine/AcDbArc.

0 Likes
Message 4 of 8

artc2
Autodesk
Autodesk

Be aware that you can't do multiple inheritance with multiple classes that are in the ARX runtime tree such as AcDbLine and AcDbArc.  The problem is that the ARX runtime class tree does not support multiple inheritance, so if you have a class that inherits from AcDbLine and AcDbArc, it won't work.

0 Likes
Message 5 of 8

Anonymous
Not applicable

Yes, AcDbCurve is a good way.

0 Likes
Message 6 of 8

Anonymous
Not applicable

thank you

0 Likes
Message 7 of 8

Anonymous
Not applicable

thanks a lot

0 Likes
Message 8 of 8

StephenPreston
Alumni
Alumni

You can't use multiple inheritance, but you can maintain pointers from your custom entity to memory-only instances of AcDbLine and AcDbArc that you have instantiated, and then rely calls to their member functions when you just need the basic behavior.

 

Cheers,

Stephen Preston
Autodesk Developer Network
0 Likes