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

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

4 REPLIES 4
Reply
Message 1 of 5
diagodose2009
1129 Views, 4 Replies

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

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

Smiley Embarassed

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

 

Smiley Frustrated

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 ]

4 REPLIES 4
Message 2 of 5

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

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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 5

I  found   the functions:

 

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

from the file : axdb.h

 

Message 4 of 5
dziwve67853
in reply to: diagodose2009

Can you give me a sample to show how to use the IAcad3DSolid_get_SolidType? Thank you!

Message 5 of 5

https://forums.autodesk.com/t5/objectarx/how-to-get-the-text-content-generated-by-the-list-command/t...

 

Trapping The Output From The AutoCAD Text Screen / Command Prompt

 

Thank you! I can get the answer.

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

Post to forums  

Autodesk Design & Make Report

”Boost