execute ILogic for all open documents

execute ILogic for all open documents

philip.G
Enthusiast Enthusiast
5,319 Views
20 Replies
Message 1 of 21

execute ILogic for all open documents

philip.G
Enthusiast
Enthusiast

Hey There

 

I was wondering. 

Is there a way to execute an I-Logic - script for all open documents? (eg. in a for-loop)

I know there is something similar for all referenced documents of an assembly but couldn't find it for all open files. 

 

I need this because I want to execute an I Logic code in a bunch of drawings but these drawings aren't all in the same assembly. (And I don't want to make an assembly just for executing this script.)

 

Thanks for your suggestions. 

 

Best Regards

 

 

 

 

0 Likes
Accepted solutions (1)
5,320 Views
20 Replies
Replies (20)
Message 21 of 21

benedikt.fecke6ZXRX
Observer
Observer

Hello everyone,

 

I want to have iproperties placed in all open documents. I tried out the code above but it doesn't work. The message says that "set" operations are no longer supported.

 

I have this but it doesn't go over to all open documents:

 

Dim i As Byte
Dim namingarraylist(3) As String
Dim oDoc As Document

namingarraylist(0) = "test1"
namingarraylist(1) = "test2"
namingarraylist(2) = "test3"


For Each oDoc In ThisApplication.Documents.VisibleDocuments
oDoc.Activate

oCustomPropertySet = ThisApplication.ActiveDocument.PropertySets.Item("Inventor User Defined Properties")

For i = 0 To UBound(namingarraylist) -1
	iProperties.Value("Custom", namingarraylist(i)) = ""
Next i

For Each oCustProp In oCustomPropertySet
	'check property name against the list you don't want to delete
	If namingarraylist.Contains(oCustProp.name)Then
		'skip it
	Else 
		'delete the custom iProperty
		oCustProp.Delete 
	End If
Next

'    End If
Next oDoc

Any ideas?

0 Likes