ads_invoke : Function Problem

ads_invoke : Function Problem

Anonymous
Not applicable
443 Views
0 Replies
Message 1 of 1

ads_invoke : Function Problem

Anonymous
Not applicable
Hi,

I am calling registered function “Func_mod” through "ads_invoke". In "Func_mod" I am modifying an entity. I am able to make an entry in my calling function i.e. Func_mod.
But I am not able to modify the entity as I am getting Arx error 101.("Attempt to modify an open entity")Through LISP I am able to call this function and also modify the entity.

This the code related to “ads_invoke”

ads_name selectedEnt;
struct resbuf *arglist, *rslt =NULL;
ads_ssget(NULL, NULL, NULL, NULL, selectedEnt);
arglist = ads_buildlist(RTSTR, “Func_mod”,RTPICKS, impliedSS, RTREAL, 96.0,0);

if(ads_invoke(arglist,&rslt) != RTNORM)
return 0;
else
// some other work


In lisp I just write following line
(Func_mod (ssget) 96.0)


When I wrote following code in "Func_mod" function for debugging for the cause of problem, I got amazing results:
// For testing ONLY
if (acdbOpenAcDbObject(pEntity, objId, AcDb::kForWrite)) != Acad::eOk)
return error;
// For testing ONLY

1. When I enter in this function through LISP, I am able to open the object.
2. I am unable to open the database when I enter in this function through ads_invoke call.

It seems that through my “ads_invoke” call, that object’s data base gets opened and that’s why I am getting that error and unable to modify that entity.

In such cases what will be solution ??
I would appreciate in some one helps me to fix this problem.

Regards,
Kimi
0 Likes
444 Views
0 Replies
Replies (0)