- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I hope someone can help me with this, because i have no idea about Programming...I use multi-bodies to creat .iam, that's why all the .ipt have no iProperties. So My purpose is to copy some iProperties from .iam to ALL the .ipt. And then open ALL the .ipt.
I creat a Form to give all info, then i can click the rule to run the program.
I don't know how to code, so i googled all the codes that i can copy. But, obviously it won't work when i put them together, don't laugh!... i will show them below as a reference. Thanks a million to whom provide the help ^^
P.s. 1. the iProperties as "No. Contrat" or "Coordonnateur Technique" have "." and space. I don't know how to code them into the program.
2. the phrase: it opens all the .ipt, inclues the multy-body.ipt. I dont want to open it and give all iproperties to it. But if it's too complicated to take it out from the programming. I can keep it.
ThisApplication.Documents.Open(oDoc.FullFileName, True) 'True is visible, false for invisible
My codes:
Sub Main()
Dim oRefName As String
If ThisDoc.Document.DocumentType = kAssemblyDocumentObject Then
'Define assembly document
Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisDoc.Document
Dim oAsmDef As AssemblyComponentDefinition
oAsmDef = oAsmDoc.ComponentDefinition
Dim oAsmRef As ComponentOccurrence
'Pick the first item
oAsmRef = oAsmDef.Occurrences.Item(1)
oRefName = oAsmRef.Name
Return
End If
'Copie les iPropriétés
iProperties.Value("Project", "Project") = _
iProperties.Value(oRefName, "Project", "Project")
iProperties.Value("Project", "Designer") = _
iProperties.Value(oRefName, "Project", "Designer")
'Open all the parts
Dim oDoc As Document
For Each oDoc In ThisApplication.ActiveDocument.AllReferencedDocuments
ThisApplication.Documents.Open(oDoc.FullFileName, True) 'True is visible, false for invisible
Next
End Sub
Solved! Go to Solution.