cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Area collapse/Expand in Mathcad15

Highlighted
Newbie

Area collapse/Expand in Mathcad15

Hi,

I need to expand or collapse an area in Mathcad 15 using excel vba.. Is it possible.. Need help.?

Tags (1)
11 REPLIES 11
Highlighted

Re: Area collapse/Expand in Mathcad15

Sorry, that is not possible.

Highlighted

Re: Area collapse/Expand in Mathcad15

Richard, is it possible using scripted components within Mathcad?  For example, can you get a region to expand/collapse based on the value of a variable?

Highlighted

Re: Area collapse/Expand in Mathcad15

Theoretically possible, but would need a good programmer to implement it.

File attached as 2 examples of modifying the XML code behind Mathcad to achieve different tasks.

a combination of these effects could create a scripted component that would open/close (disable?) an area.

the problem then is to trigger the event - an input to the component should work, but will need a functional component to test.

if an area is given a tag in the properties menu then the str2Val function approach can find it,

within the area is a section

area is-collapsed=      either    "true"  or    "false".

another section is disable-calc , again   either    "true"  or    "false".

this does appear to disable a command within the area.

the last part will be to re-write this XML code in the running file & trigger a re-calculate (if necessary).

regards

Andy

While, in theory it seems possible, the API does not allow access to all of the XML code so directly it doesn't help.

there may be other ways to access the XML but will be increasingly difficult.

Highlighted

Re: Area collapse/Expand in Mathcad15

Theoretically possible, but would need a good programmer to implement it.

Sorry, but theoretically not possible. The API allows access to the XML of a math region, but that is all. An area is not a math region, so you can't do anything with it via the API. If the Mathcad file is not open it would be possible to modify the XML of the file itself so that next time it was opened the area was either open or closed (assuming it's not locked of course), but that's all.

Highlighted

Re: Area collapse/Expand in Mathcad15

Hi

Thanks for the reply.

But I have completed the task by using some simple excel vba functions.

Regards,

Vino

Highlighted

Re: Area collapse/Expand in Mathcad15

Really? How? Via the API or by directly manipulating the XML in the Mathcad file? I know how to do it by manipulating the Mathcad file, but I see no way to do it via the API.

Highlighted

Re: Area collapse/Expand in Mathcad15

So share your solution with the community.

Highlighted

Re: Area collapse/Expand in Mathcad15

Hi,

It is not possible through direct Mathcad commands but still it possible through system screen setting commands.

MC.ActiveWindow.ScrollTo 0, rk.Y                  ''Fix Tag Name to the area which needs to be collapsed/expanded and scroll down to the location of the area by tag name.

AppActivate MC, False                                  ''Enable/Activate Mathcad screen

MC.Left = 0                                                                                          ''Set Mathcad Screen to Left Corner to the display screen.

MC.Top = 0                                                                                          ''Set Mathcad Screen to Top Corner to the display screen.

mouse_event MOUSEEVENTF_LEFTDOWN, 0&, 0&, 0&, 0&                  ''Double click command

mouse_event MOUSEEVENTF_leftUP, 0&, 0&, 0&, 0&

mouse_event MOUSEEVENTF_LEFTDOWN, 0&, 0&, 0&, 0&

mouse_event MOUSEEVENTF_leftUP, 0&, 0&, 0&, 0&

This really works.

Have fun.

Regards,

Vinoth        

Highlighted

Re: Area collapse/Expand in Mathcad15

Hi all,

Did anyone tried this.?

Any comments?

Regards,

Vino 

Highlighted

Re: Area collapse/Expand in Mathcad15

I have personally never had a reason to want to do this.

Highlighted

Re: Area collapse/Expand in Mathcad15

Can you please explain to me in Detail, how you inserted the Excel VBA script?

Thanks,

René

Announcements