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: 

iLogic - Run Rule only one time.

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
ratneshmalik1990
1554 Views, 7 Replies

iLogic - Run Rule only one time.

I have made tube with varying length.

I placed part in assembly by using "Place iLogic component". and save the assembly.

but after re opening the assembly - again getting dialogue box for enter the length.

i already enter the length in 1st time when created assembly

Capture.JPG

Autodesk Inventor Certified Professional | Mechanical Design Engineer
7 REPLIES 7
Message 2 of 8

What event trigger is causing your iLogic rule to run?

 


Autodesk Marketing Manager D&M
Opinions are my own and may not reflect those of my company.
Linkedin Twitter Instagram Facebook Pinterest

Message 3 of 8

I want iLogic rule runs only once and after the variable change it stops on that situation.
And when I place part in assebly it doesn't pop up again for variable.
E.g. If I put Length = 100mm then
Part created of 100mm length by using iLogic rule.
When I place this part in assembly it doest not again ask for Length.
"I set user parameter as a Length.
And created simple form.
And only iLogic rule used SHOW FORM."
Autodesk Inventor Certified Professional | Mechanical Design Engineer
Message 4 of 8

Please could you post your part?

 


Autodesk Marketing Manager D&M
Opinions are my own and may not reflect those of my company.
Linkedin Twitter Instagram Facebook Pinterest

Message 5 of 8

Its Autodesk Inventor 2014 version file. find attachment.

Autodesk Inventor Certified Professional | Mechanical Design Engineer
Message 6 of 8

If you delete the iLogic rule and form in the part, and tick 'Key' next to length, it should behave as you want.

 

On insert with iLogic, you will be prompted to set the Lenght, but after that - you won't be prompted again.

 

 

 


Autodesk Marketing Manager D&M
Opinions are my own and may not reflect those of my company.
Linkedin Twitter Instagram Facebook Pinterest

Message 7 of 8
wacho31
in reply to: ratneshmalik1990

Hello,

I would like to ask you if you could help me with below issue.

I would like place eg. pipes into my assembly

I set rule in part (pipe) like this:

dlugosc_rury = InputBox("Wprowadź długość rury w mm", "Długość rury", "")
iLogicVb.UpdateWhenDone = True

I would like place it many times to assembly with different length but if i used in assemlby code:

Sub Main()
	
iLogicVb.UpdateWhenDone = True
Dim oAsm As AssemblyDocument = ThisDoc.Document
For Each oRefDoc As Document In oAsm.AllReferencedDocuments
	If oRefDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Or oRefDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject AndAlso _
		oAsm.ComponentDefinition.Occurrences.AllReferencedOccurrences(oRefDoc).Count > 0
		On Error Resume Next
		iLogicVb.Automation.RunRule(oRefDoc, "dlugosc_rury")
	End If
Next  

End Sub

1. rule run only after component placing (pop up window should be visible before component placing)

2. rule run for all placed pipes (should work separately for each placed parts)

 

Could you help me with correct code?

thank you

BR

Paweł

 

 

 

 

Message 8 of 8
wacho31
in reply to: PaulMunford

Hello,

I would like to ask you if you could help me with below issue.

I would like place eg. pipes into my assembly

I set rule in part (pipe) like this:

dlugosc_rury = InputBox("Wprowadź długość rury w mm", "Długość rury", "")
iLogicVb.UpdateWhenDone = True

I would like place it many times to assembly with different length but if i used in assemlby code:

Sub Main()
	
iLogicVb.UpdateWhenDone = True
Dim oAsm As AssemblyDocument = ThisDoc.Document
For Each oRefDoc As Document In oAsm.AllReferencedDocuments
	If oRefDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Or oRefDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject AndAlso _
		oAsm.ComponentDefinition.Occurrences.AllReferencedOccurrences(oRefDoc).Count > 0
		On Error Resume Next
		iLogicVb.Automation.RunRule(oRefDoc, "dlugosc_rury")
	End If
Next  

End Sub

1. rule run only after component placing (pop up window should be visible before component placing)

2. rule run for all placed pipes (should work separately for each placed parts)

 

Could you help me with correct code?

thank you

BR

Paweł

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report