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: 

iLogic help needed

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
ryan.cotton
3047 Views, 11 Replies

iLogic help needed

I am new to the ilogic. I am wanting to use ilogic to update some prints as needed.

 

 I need to create and external rule to:

1) migrate the drawing to the lastest inventor version (2012),

2) copy all drawing resources (borders, title blocks, and sketched symbols) from a template file (.idw),

3) replace the title block and border with specified block and border. 

 

Any help would be appreciated.

Tags (1)
11 REPLIES 11
Message 2 of 12
harco
in reply to: ryan.cotton

If it's one drawing just open and save.

Copy the resources from template to drawing.

 

If you are doing many drawings.

Task Scheduler will do 1)

Drawing resource transfer wizard will do 2)

If the title block and border have the same names in target and source drawings, Drawing resource transfer wizard will do 3) too.

 

If the names are different in the template source and drawing target, in the template create copies of title and border with the target title and border names then you can replace.

 

Message 3 of 12
ryan.cotton
in reply to: ryan.cotton

I am doing multiple prints. I have tried what you have described.

The task scheduler only migrates some idws. The drawing resource wizard is great, but takes too much time and I have to manually migrate the drawings.

Can ilogic perform the tasks I mentioned in the first post? I would like to open the drawing, run the external rule to migrate, copy drawing resources including sketched symbols from a template, and update the title block and border.

Message 4 of 12
harco
in reply to: ryan.cotton

I would have thought that Task scheduler should migrate all the drawings, you may have to run a rebuild or update.

WikiHelp gives a specific migrate order http://wikihelp.autodesk.com/Inventor/enu/2013/Help/0000-Installa0/0192-Data_Mig192/0193-Data_Mig193...

4.  If you migrate specific files, follow this migration order, since assemblies depend on parts, and drawings can depend on both parts and assemblies.
    Templates
    Styles
    Parts
    Standard parts
    Sub assemblies
    Assemblies
    Presentations
    Drawings

 

If you are going to open the drawing to run a rule you may as well open a dozen drawings and use save all to migrate, it will tell you at each save that the file will be migrated and wait for you to ok.

Once you have the batch migrated then you can run the drawing transfer wizard.

 

I suppose ilogic could automatically accept the migrate warning and carry on, I don't know.

I don't use ilogic so couldn't give you any help there but I assume that any code would be doing exactly the same as the wizard so would take as long.

 

I still think the pre-programmed tools are our best option as they have been made for the job you want.

Sorry I can't be any more help.

Message 5 of 12
rhasell
in reply to: harco

Hi

 

I cant help with everything, but with the template file, perhaps this might be of some help.

 

I have a global template with a list of predefined title blocks and borders, I use iLogic to copy the selected title block to a vanilla idw. (Standard,idw) The ISO titlte block is empty to conserve file space. I have not set the code to copy symbols yet, that is still a manual process.

 

ThisDrawing.ResourceFileName = "c:\data\templates\template.idw"
ThisDrawing.KeepExtraResources = False

Dim resu1t As String="Result"
Dim T1TLE As New ArrayList
T1TLE.Add("Eng - Fabritecture")
T1TLE.Add("Eng - Greenline")
T1TLE.Add("Eng - SPLASH")
T1TLE.Add("Eng - UFS")
T1TLE.Add("Shop - Fabritecture")
T1TLE.Add("Shop - Greenline")
T1TLE.Add("Shop - SPLASH")
T1TLE.Add("Shop - UFS")
T1TLE.Add("Shop - Fab - DWG Props")
T1TLE.Add("Shop - UFS - DWG Props")

resu1t=InputListBox("Select Drawing Title Block", T1TLE, resu1t, _
Title := "Title Block", ListName := "Title Blocks from Template")

'Set iProperties based on the selection.
	If resu1t="Eng - Fabritecture" Then
	ActiveSheet.TitleBlock = "ENG-FAB"
	'End If
	ElseIf resu1t="Eng - UFS" Then
	ActiveSheet.TitleBlock = "ENG-UFS"
	'End If
	ElseIf resu1t="Shop - Fabritecture" Then
	ActiveSheet.TitleBlock = "SHOP-FAB"
	'End If
	ElseIf resu1t="Shop - UFS" Then
	ActiveSheet.TitleBlock = "SHOP-UFS"
	
	ElseIf resu1t="Shop - Fab - DWG Props" Then
	ActiveSheet.TitleBlock = "SHOP-FAB-DWG"
	'End If
	ElseIf resu1t="Shop - UFS - DWG Props" Then
	ActiveSheet.TitleBlock = "SHOP-UFS-DWG"
	
	ElseIf resu1t="Eng - SPLASH" Then
	ActiveSheet.TitleBlock = "ENG-SPLASH"
	'End If
	ElseIf resu1t="Shop - SPLASH" Then
	ActiveSheet.TitleBlock = "SHOP-SPLASH"
	'End If
	ElseIf resu1t="Eng - Greenline" Then
	ActiveSheet.TitleBlock = "ENG-GREENLINE"
	
	ElseIf resu1t="Shop - Greenline" Then
	ActiveSheet.TitleBlock = "SHOP-GREENLINE"
End If

'check for custom iprops and add them if not found
Dim propertyName1 As String = "PROJ_NAME_1"
Dim propertyName2 As String = "PROJ_NAME_2"
Dim propertyName3 As String = "PROJ_NAME_3"

customPropertySet = ThisDoc.Document.PropertySets.Item _
("Inventor User Defined Properties")

Try
          prop = customPropertySet.Item(propertyName1)
          prop = customPropertySet.Item(propertyName2)
	  prop = customPropertySet.Item(propertyName3)
Catch
      ' Assume error means not found
          customPropertySet.Add("", propertyName1)
          customPropertySet.Add("", propertyName2)
	  customPropertySet.Add("", propertyName3)
End Try

 

Other code for the border

 

resu1t = MessageBox.Show("Do You wish to Insert a Border?", "Insert Border", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
	If resu1t = "6" Then
		ThisDrawing.ResourceFileName = "c:\data\templates\template.idw"
		ThisDrawing.KeepExtraResources = False
		ActiveSheet.Border = "GDI-Border"
End If 

 

Reg
2024.2
Please Accept as a solution / Kudos
Message 6 of 12
ryan.cotton
in reply to: rhasell

That works awesome for the title block and border.  Do you know how to copy all sketched symbols from the template.idw?

Message 7 of 12
rhasell
in reply to: ryan.cotton

Not at this stage, I still select all, then copy and paste to the new drawing.

 

I only have two drawing templates, so managing symbols is not a problem, once the template is setup, I just keep all the symbols sychronised between the two (Manual Process of copy and paste)

 

If I create a new symbol, I copy it to the template as well as the Standard.idw, The template file has some rarely used symbols which I use only when needed.

 

The goal is to automate the symbol copy process as well, but I think it might take me longer to use iLogic as opposed to having them available all the time. (Perhaps a picture of each symbol on the iLogic form might be handy) Still to come though.

Reg
2024.2
Please Accept as a solution / Kudos
Message 8 of 12
ryan.cotton
in reply to: rhasell

Could it be done using the Inventor API?  Create a custom plug in?  I see the sketched symbols in the API object model, but I have no clue how to program that.

Message 9 of 12
rhasell
in reply to: ryan.cotton

Not sure, way above my level of expertise, sorry.

 

I am a noob with iLogic and VB. I have used the VB help to write some iLogic code, that works well.

Curtis_Waguespack is an iLogic guru, he might have some advice.

 

 
Reg
2024.2
Please Accept as a solution / Kudos
Message 10 of 12
Jon.Dean
in reply to: ryan.cotton

Going back to your original question, consider the following:

  1. The best method for migrating your drawings is to use the Task Scheduler, not only does it migrate the files but you can also Rebuild all the parts and views, as well as get a logfile so you can check if any files failed the migration process.
  2. You talk about the Drawing Resource Transfer Wizard, you say it is slow and time consuming, but the question is; How often are you going to use it? It is purposly written to do exactly what you want and the UI is very intuitive.
  3. Finally you mention replacing the title block and borders. The above transfer utility is designed specifically to make that easy for you. You can transfer from one drawing to many, so in my eyes, it is ideal.

Writing iLogic rules to do the same, but with less input, might seem a good idea, but what about all the time you spend writing the code and testing. Time that could be spent using the above tools.

Jon.



Jon Dean

Message 11 of 12
ryan.cotton
in reply to: ryan.cotton

Oh well. I guess I will stop trying. Thanks for all the help and input.
Message 12 of 12
Jon.Dean
in reply to: ryan.cotton

If there are any enhancements you would like with the utilities then we can log the issues with development for future improvement.

Jon.



Jon Dean

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

Post to forums  

Autodesk Design & Make Report