Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using ilogic form question

10 REPLIES 10
Reply
Message 1 of 11
Jefkee
1236 Views, 10 Replies

Using ilogic form question

Hi,

 

I made a model that can be adjusted by using a ilogic form.

This alters the parameters in my "master" part & then changes my part in my assembly.

 

Problem: the form is located in my "master" part is there a way to access the form from my assembly?

 

Thanks.

Inventor 2013
10 REPLIES 10
Message 2 of 11
mrattray
in reply to: Jefkee

You can't access the form, however you can access the parameters directly. You could also change the form to a global form, which would make it available in the assembly. What are you trying to do with it? Ae you trying to drive the part from the assembly? If so, then you need to copy that form over into your assembly and then write a rule to copy those value back over to your master part.

Mike (not Matt) Rattray

Message 3 of 11
Jefkee
in reply to: mrattray

Yes i am trying exactly that.

 

How would a rule like this look like?

Inventor 2013
Message 4 of 11
mrattray
in reply to: Jefkee

Parameter("MyMasterPart:1", "MyPartParameter") = MyAssemblyParameter

 This works only if the part is a component of the assembly.

Mike (not Matt) Rattray

Message 5 of 11
c.henderson
in reply to: Jefkee

Hello,

 

I'm pretty new to iLogic and am working on my first project.

 

I have created an assembIy with 3 components and I want to be able to drive the parameters (width and visibleheight) of one component from a iLogic form in its assembly.

I tried copying the code you suggested but I'm recieving an error, Catastrophic failure (Exception from HRESULT: 0x8000FFFF(E_UNEXPECTED)), on the piece of code (see below) when I try to drive the values from the form.

 

What I'm trying to do is drive the parameters "width" and "visibleheight" of part Q00401:1 from the assembly.

 

I can change the values in the part parameters, however they automatically revert to 0mm when I update the assembly, plus the whole point is to allow me to drive them from the iLogic form at assembly level.

 

Any help on this would be much appreciated as I'm working to pretty tight deadlines on this!

 

Message 6 of 11
Carthik_Babu
in reply to: c.henderson

Hi,

You have missed to assaign "string" name to get InputBox Output.....

 

Example:

If width > 2200 Then
MsgBox("Width exceed maximum")
width = InputBox("Prompt", "Title", "600")
End If
Parameter("Q00401:1","width") = width

 

 

Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/
Message 7 of 11
Jefkee
in reply to: c.henderson

Hi,

 

There is a way to access a from from your assembly file.

 

1) Make a rule in the master part. choose option don't run automaticlly

 

iLogicForm.Show("Form 1")

2) Make a rule in the assembly (enter the rule name that you gave youre rule in the master part)

Sub Main
auto = iLogicVb.Automation

' Set Rule name
Dim ruleName As String
ruleName = "Show Form"

' Get the active assembly. 
Dim oAsmDoc As AssemblyDocument 
oAsmDoc = ThisApplication.ActiveDocument 

' Get all of the referenced documents. 
Dim oRefDocs As DocumentsEnumerator 
oRefDocs = oAsmDoc.AllReferencedDocuments 

' Iterate through the list of documents. 
Dim oRefDoc As Document 

For Each oRefDoc In oRefDocs
	Dim rule As Object
	rule = auto.GetRule(oRefDoc, ruleName)
	If (rule Is Nothing) Then
	'Call MsgBox("No rule named " & ruleName & " was found in the document.")
	Else
	'MessageBox.Show(rule.Name, oRefdoc.displayname)
	
	Dim i As Integer
	i = auto.RunRuleDirect(rule)
	
	End If

Next 
End Sub

 

What this rule basiclly does is activate all rules in the assembly with name 'x'.

 

Hope that this helps you a bit.

 

Inventor 2013
Message 8 of 11
c.henderson
in reply to: Carthik_Babu

Thank you for your reply, it is now updating to the new width entered.
Is there a way I can get the message box to appear once I've clicked the apply button, rather than when I've closed the form and updated the assembly?
Message 9 of 11
c.henderson
in reply to: Jefkee

Thanks for replying. That works pretty well.
To make the form appear I have to run the rule in the assembly. Is it possible to have it as a button, rather than right-clicking the rule and running it?
Message 10 of 11
Carthik_Babu
in reply to: c.henderson

Hi,

Would like to know whcih verion of inventor you are using. If it is Inventor version 2012 or higher than that, You can use Form, Instead of "Input Box" Option.

 

1) In Form Tab (Near Rule Tab)--> Right Click Mouse --> Add Form

2) Change Predifined Button to "Ok Cancel Apply"

3) Drag & Drop "Width" Parameter into  the Right Tab & Press Ok

 

Predifined Button.png

 

Well you can do a lot with Form easily, you can add Text, Image, Drop Down Menu...etc.... do check out the below forum

http://forums.autodesk.com/t5/Inventor-Customization/iLogic-Forms-looking-for-some-inspiration/m-p/4...

 

 

Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/
Message 11 of 11
Jefkee
in reply to: c.henderson

You can add a rule in the Ilogic browser forms section.

 

Right click in the whit area where you can add a form. But instead of adding a form you choose edit and drag the rule into the field. This making a button for the rule (like the form buttons).

Inventor 2013

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

Post to forums  

Autodesk Design & Make Report