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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

How to fetch the units for particular region?

nileshwankhade
1-Visitor

How to fetch the units for particular region?

Hi All,
I am novice to Mathcad, and working on accessing the Mathcad variable through script.
I am facing some problems. Any help in this regards will be highly appreciated.

How to fetch the units for particular expression?

Not able to take use of �MathInterface.UnitsXML�.
Please send me any script (VB/J) or example in (C,C#,CPP or JAVA-JaCoB)language if available
9 REPLIES 9

As far as I can remember, you can't get units imported or exported in any way to/from Mathcad. Mathcad will export a unit-ed value using its default unit.

Success!
Luc

On 9/11/2009 2:14:47 AM, Luc_Meekes wrote:
>As far as I can remember, you
>can't get units imported or
>exported in any way to/from
>Mathcad. Mathcad will export a
>unit-ed value using its
>default unit.
>
>Success!
>Luc


Thanks Luc for prompt reply.

But i am bit confused with the Automation API provided with Mathcad 14.
Could you please have a look at the attached screen shot.

Please suggest.

Regards,
Nilesh

Yes, you should be able to get some XML that somehow represents units. I've never done that (even for testing), but it should just be a matter of applying the unitsXML property to a suitable Mathcad object.
__________________
� � � � Tom Gutman

When you try this what do you get? In what way doesn't it work?

Richard

On 9/11/2009 10:48:01 AM, rijackson wrote:
>When you try this what do you
>get? In what way doesn't it
>work?
>
>Richard


Hi again,

I am not getting anything ... means blank 😞
(I am using JACOB and not script)

Please suggest.

Regards,
Nilesh

No error? Just an empty string? Perhaps the region is of a type that does not have units XML. Not all math regioons do, you need to play around with different regions to see which do and which don't.
__________________
� � � � Tom Gutman

On 9/15/2009 4:07:03 PM, Tom_Gutman wrote:
>No error? Just an empty
>string? Perhaps the region is
>of a type that does not have
>units XML. Not all math
>regioons do, you need to play
>around with different regions
>to see which do and which
>don't.
>__________________
>� � � � Tom Gutman


Thanks for reply TOM.
But i had tried the same JACOB code with the various examples given in the qsheets folder of Mathcad in which the units are well defined.
But then also i m getting empty string.

It will be really helpful, if anyone check the behavior at their end.

Please suggest

Regards,
Nilesh

Check what? You present no worksheet nor code. It's anybody's guess as to what you are actually doing and what you are trying to get the units for. What do you think the rules ar for which regions have unitsXML, and how have you verified whatever assumptions you have made?

You might want to look up my define variables worksheet. While it is not exactly what you need, it does have a section that rerieves the XML from various regions. You should be able to modify that to retrieve the unitsXML instead (or, with a bit more work, in addition) and examine what does and does not have unitsXML.
__________________
� � � � Tom Gutman

>I am novice to Mathcad, and working on accessing the Mathcad variable through script.<<br> __________________________

Mathcad is not a Mic-Mac patch program, rather a ready to use tool. As a new user, you should start by getting the stuff work as a stand alone item in a Mathcad work sheet. What does mean fetching units if you can plug them directly ?

jmG
Announcements

Top Tags