Copy iProperties

Copy iProperties

GeorgK
Advisor Advisor
1,021 Views
8 Replies
Message 1 of 9

Copy iProperties

GeorgK
Advisor
Advisor

Hello together,

 

how could I copy all iProperties from one part to another part in an assembly?

 

Thank you Georg

0 Likes
Accepted solutions (1)
1,022 Views
8 Replies
Replies (8)
Message 2 of 9

MechMachineMan
Advisor
Advisor
Copy Design Properties might be a tool to look into.

Otherwise, how many files do you need to do this for? More detail is always cool too.

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 9

GeorgK
Advisor
Advisor

Hello Justin,

 

the tool is very good for some cases. But I need it a bit more flexible. Do you have an idee how to copy the iproperties to clipboard?

 

Thanks

 

Georg

0 Likes
Message 4 of 9

GosponZ
Collaborator
Collaborator

Hi George,

try this one i'm using for long time. Working good for me. You just add as many iproperties you need. There is one for e.g.

Hope it will help you. Run rule from assembly

Dim oDoc As Document = ThisDoc.Document
Dim oRefDoc As Document
For Each oRefDoc In oDoc.AllReferencedDocuments
	If oRefDoc.DocumentType = kPartDocumentObject Then
		modelName = IO.Path.GetFileName(oRefDoc.FullFileName)
	Try
		' Set the value 
		iProperties.Value("Project", "Description") = iProperties.Value(modelName, "Project", "Description")
		 
	Catch
	End Try
	End If
Next
iLogicVb.UpdateWhenDone = True

 

0 Likes
Message 5 of 9

Anonymous
Not applicable
Accepted solution

Simple code to copy description to clipboard:

 

Imports System.Windows.Forms
 
Sub Main
  Dim Description As String = iProperties.Value("Project", "Description")
  Clipboard.SetText(Description)
End Sub

 

Message 6 of 9

GeorgK
Advisor
Advisor

Hello MisterZ,

thank you very much for your help. I try it tomorrow.

Georg

0 Likes
Message 7 of 9

MechMachineMan
Advisor
Advisor
Another thing you could do for customization is write them all to an excel
file, change it in there and have them write back.

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 8 of 9

GeorgK
Advisor
Advisor

Is it possible to copy and paste the material as well?

 

Georg

0 Likes
Message 9 of 9

MechMachineMan
Advisor
Advisor

Yes, it is. Unless it is in your library in that part, then it might be a little more difficult. If you just need the name, it's still very simple.

 

http://modthemachine.typepad.com/my_weblog/2010/02/accessing-iproperties.html


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes