Hello,
Just wondering is it possible to place prompted entry into symbol1 prompted entry(), then symbol2prompted entry() into an array of symbols in order to utilize the same code.
The link shown here uses one prompted entry array for one symbol.
https://forums.autodesk.com/t5/inventor-customization/ilogic-place-sketch-symbol-with-prompted-entry...
I was able to add symbols using an array but failed to add more than one prompted entry array or indeed unable to place another set of prompted entry into an if statement to choose which symbol each set was added to. There was an error on this line
Dim sPromptStrings(4) As String
Saying unavailable due to protection.
Looking to add 5 symbols like this and having 5 rules is a lot of maintenance.
Any help greatly appreciated.
I can post the actually code I used tomorrow.
Solved! Go to Solution.
Hello,
Just wondering is it possible to place prompted entry into symbol1 prompted entry(), then symbol2prompted entry() into an array of symbols in order to utilize the same code.
The link shown here uses one prompted entry array for one symbol.
https://forums.autodesk.com/t5/inventor-customization/ilogic-place-sketch-symbol-with-prompted-entry...
I was able to add symbols using an array but failed to add more than one prompted entry array or indeed unable to place another set of prompted entry into an if statement to choose which symbol each set was added to. There was an error on this line
Dim sPromptStrings(4) As String
Saying unavailable due to protection.
Looking to add 5 symbols like this and having 5 rules is a lot of maintenance.
Any help greatly appreciated.
I can post the actually code I used tomorrow.
Solved! Go to Solution.
Solved by Michael.Navara. Go to Solution.
You want to use one code base for different sketched symbols with different number of prompts?
You want to use one code base for different sketched symbols with different number of prompts?
Thankyou for your response, correct and different content.
A Sample of what I wanted to happen .
symbol array.......
IF Symbol = “A”
Dim sPromptStrings(0) As String
ElseIf Symbol = “B”
Dim sPromptStrings(1) As String
End If
Dim oSymbol As SketchedSymbol: oSymbol = oSheet.SketchedSymbols.Add(oSymDef, oPosition, , ,sPromptStrings)
The error comes when both prompted strings Dim are entered.
Thankyou for your response, correct and different content.
A Sample of what I wanted to happen .
symbol array.......
IF Symbol = “A”
Dim sPromptStrings(0) As String
ElseIf Symbol = “B”
Dim sPromptStrings(1) As String
End If
Dim oSymbol As SketchedSymbol: oSymbol = oSheet.SketchedSymbols.Add(oSymDef, oPosition, , ,sPromptStrings)
The error comes when both prompted strings Dim are entered.
You can't declare varible twice in one code block. See the following example
'Prepare
Dim Symbol = "B"
Dim sPromptStrings As String()
If Symbol = "A"
sPromptStrings = {"A"}
ElseIf Symbol = "B"
sPromptStrings = {"B1", "B2" }
End If
'Debug
Logger.Info(String.Join(vbCrLf,sPromptStrings))
You can't declare varible twice in one code block. See the following example
'Prepare
Dim Symbol = "B"
Dim sPromptStrings As String()
If Symbol = "A"
sPromptStrings = {"A"}
ElseIf Symbol = "B"
sPromptStrings = {"B1", "B2" }
End If
'Debug
Logger.Info(String.Join(vbCrLf,sPromptStrings))
Thankyou for your response. This worked great. The sample below is the multiple PromptStrings working on seperate symbols.
'Prepare Dim SymbolList As New ArrayList SymbolList .Add("A") SymbolList .Add("B") oArray1 = InputListBox("Select one:",SymbolList, "", "iLogic", "Enter Default Answer Here") Dim Symbol As String For Each Symbol In SymbolList Dim sPromptStrings As String() If Symbol = "A" sPromptStrings = {"This is Symbol A Message"} ElseIf Symbol = "B" sPromptStrings = {"This is Symbol B Message-1", "This is Symbol B Message-2" } End If 'Debug Logger.Info(String.Join(vbCrLf, sPromptStrings)) MessageBox.Show("Symbol: "& Symbol, "Title") oArray2 = InputListBox("Select one:",sPromptStrings, "", "iLogic", "Enter Default Answer Here") Next
Thankyou for your response. This worked great. The sample below is the multiple PromptStrings working on seperate symbols.
'Prepare Dim SymbolList As New ArrayList SymbolList .Add("A") SymbolList .Add("B") oArray1 = InputListBox("Select one:",SymbolList, "", "iLogic", "Enter Default Answer Here") Dim Symbol As String For Each Symbol In SymbolList Dim sPromptStrings As String() If Symbol = "A" sPromptStrings = {"This is Symbol A Message"} ElseIf Symbol = "B" sPromptStrings = {"This is Symbol B Message-1", "This is Symbol B Message-2" } End If 'Debug Logger.Info(String.Join(vbCrLf, sPromptStrings)) MessageBox.Show("Symbol: "& Symbol, "Title") oArray2 = InputListBox("Select one:",sPromptStrings, "", "iLogic", "Enter Default Answer Here") Next
Can't find what you're looking for? Ask the community or share your knowledge.