ObjectARX

ObjectARX

Reply
Mentor
diagodose2009
Posts: 259
Registered: ‎12-04-2009
Message 1 of 3 (389 Views)

Get Type of AcDb3dSolid in ObjectARX, Get Primitive-Type from 3Dsolid?

389 Views, 2 Replies
12-16-2012 08:13 AM

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...

:smileyembarrassed:

[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 ]

 

:smileyfrustrated:

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 ]

Moderator
Alexander.Rivilis
Posts: 1,406
Registered: ‎04-09-2008
Message 2 of 3 (375 Views)

Re: Get Type of AcDb3dSolid in ObjectARX, Get Primitive-Type from 3Dsolid?

12-16-2012 09:37 AM in reply to: diagodose2009

How to obtain AcDb3dSolid OPM Properties in AutoCAD using ObjectARX/C++


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Mentor
diagodose2009
Posts: 259
Registered: ‎12-04-2009
Message 3 of 3 (331 Views)

Re: Get Type of AcDb3dSolid in ObjectARX, Get Primitive-Type from 3Dsolid?

12-29-2012 09:55 AM in reply to: Alexander.Rivilis

I  found   the functions:

 

#define IAcad3DSolid_get_SolidType(This,solidType)    \
    ( (This)->lpVtbl -> get_SolidType(This,solidType) )

from the file : axdb.h

 

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.