Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Measuring Area of a Fill Surface

Status
Not open for further replies.

Ian Cuz

Aerospace
Dec 6, 2017
18
0
0
GB
Hi everyone
I am trying to create an Parameter & Relation to hold the Area Value of a Fill Surface which can be included
within a loop
I do not want to use the SPAWorkBench measure
I am having trouble getting the Relation.CreateFormula expression to recognize the String I have built manually

See below:-

'* Recorded Macro syntax for the creation of an Area Formula Relation
' Set formula1 = relations1.CreateFormula("", "", dimension1, "area(AREA_FILLS\Fill.2 ) ")

'* Build area function Text String
strFunctionInputObjectName = "AREA_FILLS\" & strSelectedElementName

'* Message for testing purposes
MsgBox "Manually Built Text String = " & strFunctionInputObjectName, vbOKOnly, "Built String Output"

'* Use the built text string within the Create Formula function
'* This line is where the function FAILS to correctly associate the FILL surface Relation

Set formula1 = relations1.CreateFormula("Formula.1", "", dimension1, "area(strFunctionInputObjectName) ")

Can anyone help
Thanks
Ian Cuz
 
Replies continue below

Recommended for you

Set formula1 = relations1.CreateFormula("Formula.1", "", dimension1, "area(strFunctionInputObjectName) ")

maybe replace by

Set formula1 = relations1.CreateFormula("Formula.1", "", dimension1, "area(" & strFunctionInputObjectName & ") ")


Eric N.
indocti discant et ament meminisse periti
 
Many thanks itsmyjob

This alteration enabled the function to work correctly

I also have a need to create a Distance Relation between a Surface and a Point
I will attempt to adapt this answer into that solution too

Ian Cuz
 
Status
Not open for further replies.
Back
Top