Add desription to parts in assembly

Add desription to parts in assembly

kresh.bell
Collaborator Collaborator
303 Views
2 Replies
Message 1 of 3

Add desription to parts in assembly

kresh.bell
Collaborator
Collaborator

Hi,

I use a very good iLogic for me. To assign a description ti parts in assembly environment.

Dim oOccurrence As ComponentOccurrence

msg = "Select a component (press ESC to exit)"
While True
	oOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, msg)

	' If nothing gets selected then we're done	
	If IsNothing(oOccurrence) Then Exit While

	oName = oOccurrence.Name

	ThisApplication.ActiveDocument.selectset.select(oOccurrence)
	oDesc = iProperties.Value(oName, "Project", "Description")
	oDesc = InputBox(oName & " Description", "iLogic", oDesc)
	If Not oDesc = Nothing Then iProperties.Value(oName, "Project", "Description") = oDesc

End While

 

Is it possible to edit that iLogic in a way that the toolbox has two fields. Existing field and one more field with description current assembly (also possible to change)?

Something like this

Screenshot 2024-04-11 120552 ed.jpg

0 Likes
Accepted solutions (1)
304 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor
Accepted solution

Hi @kresh.bell.  Not with those simple dialogs.  And likely not even with an iLogic Form, because you would need to have interactive (event driven) control over the contents of one of those fields, which iLogic forms do not offer yet.  I believe you may need to design a vb.net based System.Windows.Forms.Form to accomplish this functionality.  That is usually done with Visual Studio, then copy most of that code over into an iLogic rule, within its own Class block of code.  It could be done without using Visual Studio, if you are familiar enough with the code involved, though.  Similar stuff has been done before entirely within iLogic rules.  When using a Windows form that you designed, you have almost total control of every aspect of the form by code, and can drive the contents and reactions with events that happen to the controls within that form.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

kresh.bell
Collaborator
Collaborator

Thanks

0 Likes