ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom AcDbEntity And Dynamic Properties

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
Anonymous
999 Views, 7 Replies

Custom AcDbEntity And Dynamic Properties

I create two custom entities. And add two new dynamic property for them.But unable to switch property in property inspector when I select them.
When I select one kind of custom entity and other basic enitty from cad, such as AcDbLine. Attribute to switch to normal in property inspector.
Such as,
OPM_DYNPROP_OBJECT_ENTRY_AUTO(CMyProOneName, MyCusOne)
OPM_DYNPROP_OBJECT_ENTRY_AUTO(CMyProTwoName, MyCusTwo)
MyCusOne And MyCusTwo area two kind of custom entities.
CMyProOneName And CMyProTwoName area their property.

I found the GetCurrentSelectionSet in IDynamicPropertyNotify2. It contain all kind of custom entities form my define.
But I had define the dynamic property for them each other.
In general, the GetCurrentSelectionSet in IDynamicPropertyNotify2 should contain a kind of class if I switch class in property inspector.
Such as, I select AcDbLine , AcDbCircle, AcDbArc. When I switch AcDbLine class , the GetCurrentSelectionSet in IDynamicPropertyNotify2 contain AcDbLine only.
And It is right if I define one kind of custom entity only. But now I can't switch class and show their property between MyCusOne And MyCusTwo in property inspector.

7 REPLIES 7
Message 2 of 8
Alexander.Rivilis
in reply to: Anonymous


@Anonymous wrote:

...And It is right if I define one kind of custom entity only. But now I can't switch class and show their property between MyCusOne And MyCusTwo in property inspector...


Maybe both class has identical display name?

 

Changing the Entity Type name that appears in the OPM window

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 3 of 8
Anonymous
in reply to: Alexander.Rivilis

I don't know if it will be problem in static properties.

In dynamic properties, 

STDMETHODIMP CMyProOneName::GetDisplayName (BSTR *pBstrName) {
if ( pBstrName == NULL )
return (E_POINTER) ;
*pBstrName =::SysAllocString (L"CusOneName") ;

return (S_OK) ;
}

I had set identical display name.

 

I had define CMyProOneName class. Both MyCusOne And MyCusTwo link to CMyProOneName class,

Although I created dynamic property CMyProOneName for MyCusOne only.

OPM_DYNPROP_OBJECT_ENTRY_AUTO(CMyProOneName, MyCusOne) 

 

Such as, I Select two entities from MyCusOne And MyCusTwo. The CMyProOneName class will run two times. 

The premise condition is I select MyCusOne entity first, and select MyCusTwo entity next. Because CMyProOneName is the property of MyCusOne.

 

If I don't define property for MyCusTwo and select MyCusTwo entity first,  MyCusOne entity won't link to CMyProOneName class. Nothing will happer. I don't show any property.

 

 

Message 4 of 8
Alexander.Rivilis
in reply to: Anonymous

Have your custom entities COM-wrappers? GetDisplayName in my post is COM-wraper method and not dynamic property method.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 5 of 8
Anonymous
in reply to: Alexander.Rivilis

 

virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;

I don't know how to set  pClsid in dynamic property.

I had try in static property.

 

Is it your meaning?

 

Message 6 of 8
Alexander.Rivilis
in reply to: Anonymous


@Anonymous wrote:

 

Is it your meaning?

 


I mean that every Custom Entity must have its own COM-wrapper. COM-wrapper class has GetDisplayName method which has return display name of entity: http://forums.autodesk.com/autodesk/attachments/autodesk/34/32974/1/com_wrapper_tutorial_2010%5B1%5D.pdf

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 7 of 8
Anonymous
in reply to: Alexander.Rivilis

Thank you very much. It work.

Message 8 of 8

Changing the Entity Type name that appears in the OPM window

Please give me a complete example, which can be in the form of a compressed file.Thank you!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report