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.
Solved! Go to Solution.
Solved by Alexander.Rivilis. Go to Solution.
@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?
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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
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.
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
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?
@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
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.