Open all drawings in assemblies

Open all drawings in assemblies

sjj.hendriks
Observer Observer
234 Views
1 Reply
Message 1 of 2

Open all drawings in assemblies

sjj.hendriks
Observer
Observer

Hi Guys,

 

I'm looking for a iLogic rule that can open all IDW's from the parts and subassemblies in the Assembly.

Do any of you have such code lying around somewhere, we still need to manually open all the drawings from the vault to check them before release😑

 

I already have this, but I dont want it to check for iproperties, but just to open all the idw's

im oDoc As AssemblyDocument = ThisDoc.Document
Dim subDoc As Document
Dim drawingDoc As DrawingDocument
Dim oFileName As String
For Each subDoc In oDoc.AllReferencedDocuments
	oFileName = Left(subDoc.FullFileName, Len(subDoc.FullFileName) - 4) & ".idw"
	If System.IO.File.Exists(oFileName) Then
		drawingDoc = ThisApplication.Documents.Open(oFileName,False)
		If drawingDoc.PropertySets.Item("Design Tracking Properties").Item("Design Status").Value = 3 Then
			drawingDoc.Close(True)
		Else
			drawingDoc.Save
			drawingDoc.Close(True)
		End If
	End If
Next

 

So if anyone can help it would be appreciated!

0 Likes
235 Views
1 Reply
Reply (1)
Message 2 of 2

basautomationservices
Advocate
Advocate

If the drawings are all named the same as the parts/subassemblies, and are all 'get' from the vault  you can use that rule, just change: 

 

	If System.IO.File.Exists(oFileName) Then
		drawingDoc = ThisApplication.Documents.Open(oFileName,False)
		If drawingDoc.PropertySets.Item("Design Tracking Properties").Item("Design Status").Value = 3 Then
			drawingDoc.Close(True)
		Else
			drawingDoc.Save
			drawingDoc.Close(True)
		End If
	End If

 

to 

 

	If System.IO.File.Exists(oFileName) Then
		drawingDoc = ThisApplication.Documents.Open(oFileName, True)
	End If

 

But if it's a big assembly I doubt you want to open everything at once..

Contact me for custom app development info@basautomationservices.com. Follow below links to view my Inventor appstore apps.

Free apps: Smart Leader | Part Visibility Utility | Mate Origins

Paid apps: Frame Stiffener Tool | Constrain Plane Toggle | Property Editor Pro


0 Likes