Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting values after running a macro

Status
Not open for further replies.

bid

Mechanical
Feb 16, 2005
2
I am trying to run and macro within a macro. Say main macro is -- macro_main and the internal macro -- macro_sub

I am passing a variable (ux) from macro_main to macro_sub as macro_sub,ux

Now, I am doing some computations inside macro_sub and would like to retain the modified value of ux in macro_sub once it returns to macro_main.

Kindly do tell me method how I can do it??

Ansys by default reverts back to original value after it excutes macro_sub and comes to macro_main. I would like to write a macro something like the *get or *set commands. is this possible?? I want to know if yes, can I increase it to more than one variable??

In short is there a concept of pass by 'pass by address' rather than 'pass by value'?? (in terms of progamming jargon c++ or Java). do remember that I cannot write 'ux' inside macro_sub as its a very generalised macro - like a function.

Only solution I can think of as of now ...

save the parameter in a file using parsav and read using parres?? any pointers will be highly appreciated.

Thanks
 
Replies continue below

Recommended for you

I guess there is no direct solution to this, you can open a command file and write the parameter there and read it back from the main macro, second option is to save the parameters by parsav and resume it in the main model by parres. But this may have some unwanted consequences (i.e. overwriting the parameters in the main macro).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor