Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Relation Name With Macro

Status
Not open for further replies.

dddn

Mechanical
Nov 26, 2022
35
Hello everybody.
I want to get the text which is contained on a Formula.1, for example, with a CATScript macro:
If I write formula.Value I only get the result, that is "Length.1"; instead I would like to get: 'PartBody\Pad.3\First limit\Depth' = Lenght.1
Thank you all
 
Replies continue below

Recommended for you

do you start with the relations?
Code:
Dim oRelations As Relations
Set oRelations = oActiveDoc.Part.Relations


regards,
LWolf
 
i would try relation.Modify(...) but you might need KWA lic for that according to chm file

Sub Modify(CATBSTR iValue)
Modifies the relation.
Parameters:
iValue
The new relation value Except on formula, this method requires the KWA license (Knowledge Advisor).

Eric N.
indocti discant et ament meminisse periti
 
The formula is as follows:
formula100: PartBody\Pad.3\First limit\Depth'= Length.1
The program I wrote:

set formula= relations.item("formula100")
msgbox formula.value

and the message that appears is: Length.1

I always want to get with a msgbox: 'PartBody\Pad.3\First limit\Depth'
 
Hello,
the solution is:

msgbox part1.Parameters.GetNameToUseInRelation(formula.GetOutParameter(1))

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor