Skip to main content
1-Visitor
Question

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.?

11 replies

19-Tanzanite

Sorry, that is not possible.

Translate
1-Visitor

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?

Translate
12-Amethyst

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.

Translate
vmurugan1-VisitorAuthor
1-Visitor

Hi

Thanks for the reply.

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

Regards,

Vino

Translate
19-Tanzanite

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.

Translate
vmurugan1-VisitorAuthor
1-Visitor

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        

Translate
vmurugan1-VisitorAuthor
1-Visitor

Hi all,

Did anyone tried this.?

Any comments?

Regards,

Vino 

Translate
19-Tanzanite

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

Translate