Creating new assembly from one with iLogic components and configurations

Creating new assembly from one with iLogic components and configurations

1830108CDDDF
Contributor Contributor
866 Views
5 Replies
Message 1 of 6

Creating new assembly from one with iLogic components and configurations

1830108CDDDF
Contributor
Contributor

Hello everyone, I've been working on and assembly with iLogic components, there is a way to create a new assembly from the main without affecting the derivated assembly? This would be the worklflow that I'm thinking:

  1. Main assembly
  2. Enter the paramateres that I need 
  3. Export the new assembly with those parameters

Thanks in advance, regards.

 

0 Likes
Accepted solutions (1)
867 Views
5 Replies
Replies (5)
Message 2 of 6

A.Acheson
Mentor
Mentor

Hi @1830108CDDDF 

 

Any chance of a few images of what your looking to achieve? Screenshots of the browser would help. One way to achieve you goal using the built in ilogic place component command is as follows.

 

1. Main Assembly: Enter Parameters

 

AAcheson_0-1685591223957.png

 

2. Use Place Ilogic component, browse to assembly.

 

AAcheson_1-1685590494860.png

 

3.Select the Main assembly parameters and link them to the ilogic controlled files.

 

AAcheson_0-1685590060877.png

 

4.Sub assembly now saved in Main assembly with configuration.

 

AAcheson_3-1685590692850.png

 

5.New File Locations, where (O) is Original files and (N) is New Configuration. 

 

AAcheson_7-1685590889676.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 6

1830108CDDDF
Contributor
Contributor

Hi @A.Acheson

I have this structure:

1830108CDDDF_0-1685592437891.png

Placed the components and linked to my defined parameters in the assembly4

1830108CDDDF_1-1685592488247.png1830108CDDDF_2-1685592500343.png

What I need is to generate 25 configurations from this "main" assembly, How do I export a new configuration (assembly) 

 

0 Likes
Message 4 of 6

1830108CDDDF
Contributor
Contributor

Hi @A.Acheson

I have this structure:

1830108CDDDF_0-1685592437891.png

Placed the components and linked to my defined parameters in the assembly4

1830108CDDDF_1-1685592488247.png

1830108CDDDF_2-1685592500343.png

What I need is to generate 25 configurations from this "main" assembly, How do I export a new configuration (assembly) 

 

0 Likes
Message 5 of 6

A.Acheson
Mentor
Mentor
Accepted solution

Hi @1830108CDDDF 

The easiest method is to use the ilogic place component tool as above. But I understand that is not great for larger volumes. You can try this code below to create a new assembly with new parts.  You will need to work in code to change the parameters. 

For index As Integer = 1 To 5
	Try	
		Dim asmDoc As AssemblyDocument = ThisApplication.ActiveDocument
		
		'Find previously place index if any.
		Dim assyFilenameSplit As String() = ThisDoc.FileName(False).Split("-")
		Dim newAssemblyFileName As String = ThisDoc.Path & "\" & assyFilenameSplit(0) & "-" & index & ".iam"
		
		' Save assembly with new name.
		asmDoc.SaveAs(newAssemblyFileName, False)
		
		For Each refDoc As Document In asmDoc.ReferencedDocuments
				Dim refDocFileName As String = refDoc.FullFileName
				Dim refDocDirectory As String = IO.Path.GetDirectoryName(refDocFileName) 
				Dim fileName As String = IO.Path.GetFileNameWithoutExtension(refDocFileName)
				
				' Find previously place index if any.
				Dim filenameSplit As String() = fileName.Split("-")
				
				Dim refDocNewFileName As String = refDocDirectory & "\" & filenameSplit(0) & "-" & index & ".ipt"
				
				refDoc.SaveAs(refDocNewFileName, False)
				
				' Replace part reference.
				asmDoc.File.ReferencedFileDescriptors.Item(refDocFileName).ReplaceReference(refDocNewFileName)
				asmDoc.Save
		Next
	Catch
	End Try
Next
MessageBox.Show("All Done", "Rename files", MessageBoxButtons.OK, MessageBoxIcon.Information)

The Results

AAcheson_0-1685597207621.png

 

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

1830108CDDDF
Contributor
Contributor

@A.Acheson Thanks, it works! Appreciate taking your time for reply.

0 Likes