Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Constraint.Add Variable error

1 REPLY 1
SOLVED
Reply
Message 1 of 2
jake_pietrzak
161 Views, 1 Reply

Constraint.Add Variable error

Hi All, I have small( I hope ) problem, and hoped that you may help me solve it.

 

I made a rule that add constraints to parts in assembly.

Name of the occurrence is declared as SharedVariable in other rule.

When try to use this SharedVariable in my constraint rule,  I have an error that you can see below:

jakepietrzak_0-1661947851043.png

 

Below part of rule that gives me that error:

 

 

For i = 1 To 10
	
oName1 = SharedVariable("FromArray" & i) 
oName2 = SharedVariable("FromArray" & i + 1)

Constraints.AddFlush("Flush2_" & i, oName1, "FrontFace", oName2, "FrontFace",
					offset := 0.0, biasPoint1 := Nothing, biasPoint2 := Nothing)
Next

 

 

Many Thanks!

1 REPLY 1
Message 2 of 2
cidhelp
in reply to: jake_pietrzak

try this:

For i = 1 To 10

Dim oName1 as string = SharedVariable("FromArray" & i)
Dim oName2 as string = SharedVariable("FromArray" & i + 1)

Constraints.AddFlush("Flush2_" & i, oName1, "FrontFace", oName2, "FrontFace",
offset := 0.0, biasPoint1 := Nothing, biasPoint2 := Nothing)
Next

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report