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: 

Configurator360 Error.

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Anonymous
455 Views, 6 Replies

Configurator360 Error.

Hello everybody.

 

I have a testassembly wich I want to upload to the configurator360. Hereby my problem is that I get an error message on it when I change the parameters. But it works just fine inside inventor.

 

Hereby the coding I used for the assembly.

It's probably the usage of shared variables or the reverences to partfiles that aren't converted properly.

Any help would be appreciated.

Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

Dim oDocDef As AssemblyComponentDefinition
oDocDef = oDoc.ComponentDefinition

Dim oComp As ComponentOccurrence
On Error Resume Next

'Dim excel As String = "C:/test/Map1" 'excelbestand
Dim lengte As Integer = TotalLength
 'waarde totale lengte
Dim tussen As Integer= Standard 'waarde standaard lengte tussendelen
Dim mineindlengte As Integer = Minimum
Dim tussenstukken As Integer = lengte 'totale waarde voor tussendelen
Dim tussenberekening As Double = tussen + mineindlengte
Dim A As Integer = 0 'aantal standaard lengtes
Dim B As Integer = tussenstukken 'voor overige lengte
Dim D As Integer = 1 'aantal geplaatste tussenstukken
Dim C As Integer = D + 1 'te plaatsen nummer
Dim E As String = A 'voor plaatsen flushes met variabelen
Dim G As Integer = 4 'flushnummer
Dim H As Integer = 1

'verwijderen van bijna alle componenten
For Each oComp In oDocDef.Occurrences
Dim Test As String = ("Test2:" & H)
If H = 1 Then 'deleting test2: vanaf 2
	Parameter.Quiet = True
		'MsgBox("Werkt")
	H = H + 1
Else If H > 1 Then
	Components.Delete(Test)
	H = H + 1
End If

If oComp = "Test3:1" Then 'deleting var. length
	Components.Delete("Test3:1")
End If

Next


'berekenen hoeveel standaard lengtes en welke lengte over moet zijn
Do While B >= tussenberekening
	A = A + 1
	B = B - tussen
Loop
If B = tussen Then
	A = A + 1
	B = B - tussen
End If

MsgBox(A & "x" & tussen & "+" & B)

SharedVariable("aantal") = A
SharedVariable("standaardlengte") = tussen
SharedVariable("variabelelengte") = B

'plaatsen van standaard lengtes
Do While D < A
	'MsgBox(C)
	Parameter.Quiet = True
	Test2 = "C:\test\Test2.ipt"
	Components.Add("test2:" & C, Test2, position := Nothing, grounded := False, visible := True, appearance := Nothing)
	Constraints.AddFlush("Flush" & G, "Test2:" & D, "YZ PLANE", "Test2:" & C, "YZ PLANE",
                     offset := tussen, biasPoint1 := Nothing, biasPoint2 := Nothing)
	G = G + 1
	Constraints.AddFlush("Flush" & G, "Test2:" & D, "XZ PLANE", "Test2:" & C, "XZ PLANE",
                     offset := 0.0, biasPoint1 := Nothing, biasPoint2 := Nothing)
	G = G + 1
	Constraints.AddFlush("Flush" & G, "Test2:" & D, "XY PLANE", "Test2:" & C, "XY PLANE",
                     offset := 0.0, biasPoint1 := Nothing, biasPoint2 := Nothing)
	G = G + 1
	D = D + 1
	C = C + 1
Loop

''MsgBox (D)

'plaatsen van variabele lengte
Do While B > 0
	Parameter.Quiet = True
	Test3 = "C:\test\Test3.ipt"
	Components.Add("test3:1", Test3, position := Nothing, grounded := False, visible := True, appearance := Nothing)
	Constraints.AddFlush("Flush" & G, "Test2:" & D, "YZ PLANE", "Test3:1", "YZ PLANE",
                     offset := tussen, biasPoint1 := Nothing, biasPoint2 := Nothing)
	G = G + 1
	Constraints.AddFlush("Flush" & G, "Test2:" & D, "XZ PLANE", "Test3:1", "XZ PLANE",
                     offset := 0.0, biasPoint1 := Nothing, biasPoint2 := Nothing)
	G = G + 1
	Constraints.AddFlush("Flush" & G, "Test2:" & D, "XY PLANE", "Test3:1", "XY PLANE",
                     offset := 0.0, biasPoint1 := Nothing, biasPoint2 := Nothing)
	B = B - B
Loop


'Calling rules in parts

auto = iLogicVb.Automation

' Set Rule Name
Dim ruleName As String
ruleName = "update length"

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

' Get all of the referenced docments.
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
	Else
		
	Dim i As Integer
	i = auto.RunRuleDirect(rule)
	End If

Next

iLogicVb.DocumentUpdate

MessageBox.Show("Test2 (blauw) representeren standaard lengtes en Test3 (Geel) een variabele lengte", "uitleg testnamen")

SharedVariable.RemoveAll()

6 REPLIES 6
Message 2 of 7
xingyichuan
in reply to: Anonymous

Hi Wander,

 

There are several iLogic known limitations for Configurator 360 design. For example, we cannot use any interactive functions, including forms and the MessageBox function, cannot use the ThisApplication object, etc.

 

Please check below document in detail which also include the workarounds for that.

http://help.autodesk.com/view/CFG360/ENU/?guid=GUID-96EA0CAA-73BB-42C2-94D8-73CC76791DC7

 

Hope this helps.

 

Thanks,

Guy Xing

Message 3 of 7
Anonymous
in reply to: xingyichuan

Is this a part of an interactive function?

Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

Dim oDocDef As AssemblyComponentDefinition
oDocDef = oDoc.ComponentDefinition

Dim oComp As ComponentOccurrence

Also if it isn't is there a little more help on the coding for the %temp% folder you can call in 360? Can't seem to figure it out.

Message 4 of 7
xingyichuan
in reply to: Anonymous

Hi Wander, 

 

Please try to use "ThisServer" instead of "ThisApplication". 

And you can write files to the %TEMP% folder, and they persist during the session.

 

Could you please share the Configurator 360 designs (the url of the design) or the dataset with the iLogic which is failed to upload?

 

Thanks,

Guy Xing

Message 5 of 7
Anonymous
in reply to: xingyichuan

Here's the online link:

https://configurator360.autodesk.com/810676209937569296/szcsgs3334r4

 

I've updated the programming a little bit (look at place part 1). Test rule whas not in it while i uploaded the file.

 

Filepath's used: "C:/Test/...."

 

Message 6 of 7
xingyichuan
in reply to: Anonymous

Hi Wander,

 

Thanks for sharing the dataset, and it helps to narrow down the issue.

I have resolved the limitation issues in your attached file.  There are two limitations you need to take care:

 

  1. Please use the 'ThisDoc' instead of  'ActiveDocument' which may caused the error => 'ActiveDocument' on type 'InventorServerClass' not found
  2. You can use the `System.IO.Path.GetTempPath()' to get the temp path in the current session, or you can use the ThisDoc.Path to get the current work directory. 

Attachment is the updated dataset. Hope this helps.

 

BTW, In order to avoid the duplicated effort, I only update this topic. Please also help to update the below topic if the solution works for you. Thank you!

https://forums.autodesk.com/t5/configurator-360-forum/could-somebody-help-me-working-around-restrict...

 

Regards,

Guy Xing

Message 7 of 7
Anonymous
in reply to: xingyichuan

Thank you so much.

 

I was out of the office so I couldn't update it much faster but it works and i will look into it a bit more to exactly understand what I did wrong.

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

Post to forums  

Autodesk Design & Make Report