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

Convert ads_name to VLA-Object from C++ARX?

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

Convert ads_name to VLA-Object from C++ARX?

Hello...
Title:  Convert ads_name to VLA-Object from C++ARX?

I  want a function convert "vlax_ename2vla_objectC"
The "vlax_ename2vla_objectC",will convert "ads_name" to "vla-object"
You replace the "????" with your source C++ARX.
I need only VisualC++ARX
I need one function ads_retVLA_object(rr);

The function "vlax_ename2vla_objectC" return value idem with llisp:

(type (vlax-ename->vla-object (car (entsel)))
Please help me...!

[source=vlisp]
(Defun vlax_ename2vla_objectL(arg1_as_RTENAME / rr)
  (setq g (type arg1_as_RTENAME))
  (setq rr (vlax-ename->vla_objectarg1_as_RTENAME )
rr)
[/source=vlisp]



[source=cpp]

Smiley Tongue
int
/*FCN*/vlax_ename2vla_objectC()
{
    struct resbuf *pArgs =acedGetArgs ();
    if(!pArgs)
      return acedRetNil();
     if(pArgs->restype != RTENAME)
      return acedRetNil();

    AcDbObjectId id;
    if(acdbGetObjectId(id,pArgs->resval.rlname) != Acad::eOk)
      return acedRetNil();
   "????"
   "????"
   "????"
   ads_retVLA_object(VLA-OBJECT)
}
[/source=cpp]


[source=virtualC+lisp]
(Defun vlax_ename2vla_objectC2012(a008 / e rr g j)
/*c2s: rr=nil,
       g=(listp(e)&&(e!=nil))?dfn_ent_dxf_01(e):a008,
       e=(type(g)==quote(ENAME))?g:nil,
       j= (type(a008) == quote(VLA_OBJECT));
       if (e)
           rr=vlax.ename->vla_object(e);
       else
           { if (j) rr=a008;
                   else  alert("a008errC");
           };
*/
rr)
[/source=virtuaC+lisp]

4 REPLIES 4
Message 2 of 5
Balaji_Ram
in reply to: diagodose2009

Hello,

 

Have you tried using the "ObjectIdToObject" method in the IAcadDocument interface ?

This will provide you with a pointer to the COM Interface (Ex : IAcadCircle) for the ObjectId that you pass to it as parameter.

 

You can find it under <ObjectARX folder>\samples\com\AsdkMfcComSamp_dg\CAcadDocument.h.

 

Hope this helps.



Balaji
Developer Technical Services
Autodesk Developer Network

Message 3 of 5

Hi, Balaji!
But how can return this pointer from arx to lisp? IMHO it is impossible.

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

Hi Alexander,

 

I am not sure if the developer wants to pass it over to Lisp, because in that case the "vlax-ename->vla-object" would get the vla-object.

 

I thought the developer wanted to get the COM object using an ObjectId using C++ alone and had provided the Lisp code as a demonstration of what he wanted to do.

 

Sorry, but I might be wrong in understanding the question.

 

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 5 of 5

Hi, Balaji!

diagodose2009 try to develop lisp to arx compiler/converter. It is understandable on the questions which he regularly gives on this forum. That is why hi try to emulate (vlax-ename->vla-object) lisp-function with ObjectARX code.

 

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

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

Post to forums  

Autodesk Design & Make Report

”Boost