ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 5
Anonymous
505 Views, 4 Replies

acedPutSym

Dear ADG,

 

I try to set variable with acedPutSym.

Here the code:

 

struct resbuf rb;
rb.restype=RTREAL;

rb.resval.rreal=100;

int ret=-1;
ret=acedPutSym(L"PannRettD",&rb);
if (RTNORM!=ret) acedAlert(L"Error");

 

It doesn't work.  ret=-5001.

Why? which is the problem?

what does the warning "This command can be used in the ARX program environment only when AutoCAD sends the message kInvkSubrMsg to the application" mean? I need to do something else before?

 

Thank you.

Regards,

 

Mario

Tags (1)
4 REPLIES 4
Message 2 of 5
Alexander.Rivilis
in reply to: Anonymous

As far as VisualLisp executing in document context, your's application, wich call acedPutSym, must executed also in document context. So it is possible from function registered with acedDefun or from command without flag

ACRX_CMD_SESSION

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

Hi.. is my code

I make tests .. all tests work-fine

 

[source=cpp]

#define _error_ (condi, message) { if (condi) { ads_printf(L ##  message)};};

inline ads_real
/*FCN*/lisp_assig(const tchar variabile,ads_real marioriva)
{ ads_real rr=0.0;
  static struct resbuf * a1;
  rr=RTREJ;
  a1=nil;
  _error_tif(nil==variabile,"g438.error Rej");
  a1 = ads_buildlist(RTREAL,marioriva, NULL);
  int kj = ads_putsym(variabile, a1);        
  ads_relrb(a1);
  a1 = nil;
  _error_(kj!=RTNORM,"g438.error set");

 rr=marioriva;

  return(rr);
};

 

inline int
/*FCN*/lisp_assig(const tchar variabile,int vashort)
{ int rr;
  static struct resbuf * a1;
  rr=RTREJ;
 _error_(nil==variabile,"g438.error rej");
  a1=nil;
  if (variabile==nil)   //euaici: aici seteaza variabila din lisp
       return(rr);
  a1 = ads_buildlist(RTSHORT, vashort, NULL);
  int kj = ads_putsym(variabile, a1);        
  ads_relrb(a1);
  a1 = nil;
  _error_(kj!=RTNORM,"g438.error sEt");
  return(rr);

};
[/code=cpp]

 

 

Message 4 of 5
Anonymous
in reply to: diagodose2009

Thank you.

 

Regards,

 

Mario

Message 5 of 5
Alexander.Rivilis
in reply to: Anonymous


@Anonymous wrote:

Thank you.

 

Regards,

 

Mario


I wonder whether you could use the acedPutSym function? I looked at your code again and saw that you did not have enough line of code:

rb.rbnext = NULL;

 

 

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