Add prompt for Operation number that will auto fill that common number on other rules

Add prompt for Operation number that will auto fill that common number on other rules

bbrumfield
Advocate Advocate
389 Views
3 Replies
Message 1 of 4

Add prompt for Operation number that will auto fill that common number on other rules

bbrumfield
Advocate
Advocate

I have a rule (with the help from many on this forum) that actually runs multiple rules back to back, all of the iProperties created need to be linked to a common number 1,2,3....what I have works however I think it could be easier and a bit more intuitive. There will be several other Rules added along the way to create other iProperties/Values

 

Dim oDoc As Document = ThisDoc.Document

Dim CustTypeWC As New ArrayList
CustTypeWC.Add("WC A01 Engineer")
CustTypeWC.Add("WC C02 Laser / Punch")
CustTypeWC.Add("WC D01 Debur")
CustTypeWC.Add("WC E01 Form")
CustTypeWC.Add("WC E02 Panel Bender")
CustTypeWC.Add("WC E03 Roll")
CustTypeWC.Add("WC F01 Robotic Cell")
CustTypeWC.Add("WC G01 Pem Insert")
CustTypeWC.Add("WC H01 Weld / Grind")
CustTypeWC.Add("WC I01 Spot Weld")
CustTypeWC.Add("WC J01 Grind")
CustTypeWC.Add("WC K01 Powder Coat")
CustTypeWC.Add("WC L01 Mask / Plug")
CustTypeWC.Add("WC M01 Package")
CustTypeWC.Add("WC N01 Assemble")
CustTypeWC.Add("WC Q01 Quality")
CustTypeWC.Add("WC Z01 Anodize")
CustTypeWC.Add("WC Z02 Chemical Film")
CustTypeWC.Add("WC Z03 Plate")
CustTypeWC.Add("WC Z04 Silk Screen")
CustTypeWC.Add("WC Z05 Stamp")
CustTypeWC.Add("WC Z06 Strip")
CustTypeWC.Add("WC Z07 Sub Assemble")
CustTypeWC.Add("WC Z08 Sub Labor")
CustTypeWC.Add("WC Z09 Sub Weld")


Dim oSelCustTypeWC As String = InputListBox("Select Operation", CustTypeWC, oOperation1, Title := "Select Work Center", ListName := "Work Center")
'if this custom property doesn't exist, this next line will also create it if needed (no error shown)
iProperties.Value("Custom", "Operation" & Space(1) & InputBox("Input Operation Number", "Operation Number?", 0)) = oSelCustTypeWC

iProperties.Value("Custom", "Setup Time" & Space(1) & InputBox("Input Setup Instance", "If Operation 1 Enter 1", 0)) = CObj(InputBox("Enter Setup Time(Enter 0 if no value is available)", "Setup Time", 30))

Dim CustTypeMC As New ArrayList
CustTypeMC.Add("M A01 Eng 1")
CustTypeMC.Add("M C02 Laser / Punch")
CustTypeMC.Add("M D01 Debur")
CustTypeMC.Add("M E01 Form")
CustTypeMC.Add("M E02 Panel Bender")
CustTypeMC.Add("M E03 Roll")
CustTypeMC.Add("M F01 Robotic Cell")
CustTypeMC.Add("M G01 Pem Insert")
CustTypeMC.Add("M H01 Weld / Grind")
CustTypeMC.Add("M I01 Spot Weld")
CustTypeMC.Add("M J01 Grind")
CustTypeMC.Add("M K01 Gas Fired Powder Coat")
CustTypeMC.Add("M K02 Infrared Powder Coat")
CustTypeMC.Add("M L01 Mask / Plug")
CustTypeMC.Add("M M01 Package")
CustTypeMC.Add("M N01 Assemble")
CustTypeMC.Add("M Q01 Quality")
CustTypeMC.Add("M Z01 Anodize")
CustTypeMC.Add("M Z02 Chemical Film")
CustTypeMC.Add("M Z03 Plate")
CustTypeMC.Add("M Z04 Silk Screen")
CustTypeMC.Add("M Z05 Stamp")
CustTypeMC.Add("M Z06 Strip")
CustTypeMC.Add("M Z07 Sub Assemble")
CustTypeMC.Add("M Z08 Sub Labor")
CustTypeMC.Add("M Z09 Sub Weld")

Dim oSelCustTypeMC As String = InputListBox("Select Operation", CustTypeMC, oMachineCode1, Title := "Select Machine Code", ListName := "Machine Code")
'if this custom property doesn't exist, this next line will also create it if needed (no error shown)
iProperties.Value("Custom", "Machine Code" & Space(1) & InPutBox("Input Machine Code Instance, If Operation 1 Enter 1", "Machine Code Instance?", 0)) = oSelCustTypeMC

iProperties.Value("Custom", "Run Time" & Space(1) & InputBox("Input Run Instance", "If Operation 1 Enter 1", 0)) = CObj(InputBox("Enter Run Time(Enter 0 if no value is available)", "Run Time", 0.12))

Dim CustTypeSubPO As New ArrayList
CustTypeSubPO.Add("Anodize-" & iProperties.Value("Custom", "Drawing Number"))
CustTypeSubPO.Add("Irridite-" & iProperties.Value("Custom", "Drawing Number"))
CustTypeSubPO.Add("Plating-" & iProperties.Value("Custom", "Drawing Number"))
CustTypeSubPO.Add("Silk Screen-" & iProperties.Value("Custom", "Drawing Number"))
CustTypeSubPO.Add("Stamp-" & iProperties.Value("Custom", "Drawing Number"))
CustTypeSubPO.Add("Sub Labor-" & iProperties.Value("Custom", "Drawing Number"))

Dim oSelCustTypeSubPO As String = InputListBox("Select P/Order Stock Code 1", CustTypeSubPO, SubPOStockCode1, Title := "P/Order Stock Code Selector 1", ListName := "P/Order Stock Code 1")
'if this custom property doesn't exist, this next line will also create it if needed (no error shown)
iProperties.Value("Custom", "P/Order Stock Code 1") = oSelCustTypeSubPO


Thanks,

Brent

 

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

A.Acheson
Mentor
Mentor

It sounds like you might be up against the limit of the out of the box input and list boxes. Maybe you might consider using VBA form or if you have visual studio a VB.net form. With these types of forms you can present the users with the information in one form so a little easier on the eyes. 

AAcheson_0-1650335139313.png

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 4

WCrihfield
Mentor
Mentor

Hi @bbrumfield.  I believe you mentioned a need to be able to share common data across multiple iLogic rules...Is that correct?  If so, then you may be able to take advantage of either the SharedVariable interface tools, or the RuleArguments interface tools, along with the NameValueMap object, within your iLogic rules.  These tools are specifically for helping us share data between iLogic rules.  Here is a link to one of my contribution posts about sharing data between iLogic rules that you might find helpful.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 4

bbrumfield
Advocate
Advocate
Accepted solution

Hi WCrihfield,
Thank you, Ill do some experimenting with this, I think if I'm reading correctly namevaluemap should do the trick. I'm working on a form to run the "Add Op Rule" screen shots below (Work in Process).
As you can see in the form view there is number sequence for Operation, Machine Code etc, which will be needed for mapping to CadTalk which in turn will save the information to our ERP.




Thanks,

Brent F. Brumfield
Director of Engineering
P: (513) 385-0555
M: (513) 309-6643
bbrumfield@arscometals.com
www.arscomfg.com

[cid:image003.png@01D853D9.8DCB4FF0]





0 Likes