Hi...
I need help ,
i want determine type of AcDb3dSolid.. in ACHAR *.
You replace "???" with other function.. in first source
The routine C++ARX ,wiil set result=_T("Cylindre"") or ("Sphere")..or ("Torus")..
VC++2010 .. display the message:
l:\1user\arx2010\i(32): error C2039: 'SolidType' : is not a member of 'AcDb3dSolid'
Regards...
[source=cpp ObjectARX ]
ACHAR * result=nil;
AcDb3dSolid * pSolid=nil;
pSolid = (AcDb3dSolid *)pObj;
if (pSolid==nil)
{ pObj->close();
pObj=nil;
exitif(1,"g334.error 3d");
};
if (pSolid->isNull)
{ pObj->close();
pObj=nil;
exitif(1,"g334.error nil");
};
result=pSolid->SoildType()????
pObj->close();
pObj==nil;
pSolid->close();
pSolid=nil;
[/source=cpp ObjectARX ]
I found Visual LISP source,bellow:
[source=visual-lisp ]]
(vl-load-com)
(if (and
;; solid selection
(setq cyl (car (entsel "\nSelect a cylinder: ")))
;; changing ename to vla-object
(setq cyl (vlax-ename->vla-object cyl))
;; checking if it's a 3d solid
(= (vla-get-ObjectName cyl) "AcDb3dSolid")
;; checking if it's a cylinder (primitive)
(= (vl-catch-all-apply 'vla-get-SolidType (list cyl))
"Cylindre"
)
)
(setq
;; cylinder height
ht (* 2
(distance (vlax-get cyl 'Position) (vlax-get cyl 'centroid))
)
;; cylinder radius
rad (sqrt (/ (vla-get-Volume cyl) (* pi ht)))
)
(princ "\nUnvalid Entity.")
[/source=visual-lisp ]
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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 found the functions:
#define IAcad3DSolid_get_SolidType(This,solidType) \
( (This)->lpVtbl -> get_SolidType(This,solidType) )
from the file : axdb.h
Can you give me a sample to show how to use the IAcad3DSolid_get_SolidType? Thank you!
Trapping The Output From The AutoCAD Text Screen / Command Prompt
Thank you! I can get the answer.