ObjectARX

ObjectARX

Reply
Mentor
diagodose2009
Posts: 262
Registered: ‎12-04-2009
Message 1 of 5 (299 Views)

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

299 Views, 4 Replies
01-06-2013 07:51 AM

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]

:smileytongue:
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]

ADN Support Specialist
Balaji_Ram
Posts: 701
Registered: ‎03-21-2011
Message 2 of 5 (262 Views)

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

01-15-2013 07:28 AM 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

Moderator
Alexander.Rivilis
Posts: 1,417
Registered: ‎04-09-2008
Message 3 of 5 (258 Views)

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

01-15-2013 07:44 AM in reply to: Balaji_Ram

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


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

ADN Support Specialist
Balaji_Ram
Posts: 701
Registered: ‎03-21-2011
Message 4 of 5 (251 Views)

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

01-15-2013 08:09 AM in reply to: Alexander.Rivilis

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

Moderator
Alexander.Rivilis
Posts: 1,417
Registered: ‎04-09-2008
Message 5 of 5 (246 Views)

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

01-15-2013 09:17 AM in reply to: Balaji_Ram

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.

 

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

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.