Skip to main content
1-Visitor
April 21, 2016
Question

Area collapse/Expand in Mathcad15

  • April 21, 2016
  • 3 replies
  • 6059 views

Hi,

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

3 replies

19-Tanzanite
April 21, 2016

Sorry, that is not possible.

1-Visitor
April 21, 2016

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?

12-Amethyst
April 21, 2016

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.

vmurugan1-VisitorAuthor
1-Visitor
April 22, 2016

Hi

Thanks for the reply.

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

Regards,

Vino

19-Tanzanite
April 22, 2016

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.

vmurugan1-VisitorAuthor
1-Visitor
May 6, 2016

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        

vmurugan1-VisitorAuthor
1-Visitor
June 24, 2016

Hi all,

Did anyone tried this.?

Any comments?

Regards,

Vino 

19-Tanzanite
June 24, 2016

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