Get Type of AcDb3dSolid in ObjectARX, Get Primitive-Type from 3Dsolid?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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 ]

