Message 1 of 3
"[AIS 2010 + SP2] print PropertySets and Properties
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I discovered this problem while working on a sub (with help of some forum-users). Ik replied this in http://discussion.autodesk.com/forums/thread.jspa?threadID=762164 , but while getting deeper in it, I decide this is a totaly different problem as described in this thread.
With a simple code I retrieve all PropertySets and their Properties.
{code}
Option Explicit
Public Sub AllPropSetsAndProps()
Dim oPropSet As PropertySet
Dim oProp As Property
For Each oPropSet In ThisApplication.ActiveDocument.PropertySets
Debug.Print oPropSet.DisplayName & " Count: " & oPropSet.Count
For Each oProp In oPropSet
Debug.Print " '" & oProp.Name & "' = '" & oProp.Value & "'"
Next
Next
End Sub
{code}
In a testpart I used this code, and it works. Now I copy past it to another document and then I get an error.
Run-time error '91'
Object variabele or With block variable not set
I get this error halfway executing the code. Everytime the code end on the same property
{code}
'Catalog Web Link' = ''
{code}
The next property should be:
{code}
'Part Icon' = '0'
{code}
The weird part is that when I create a new document holding the Shift + Ctrl buttons the error don't show up.
Is there anyone who can tell me wat is going wrong here..
thnx in advance,
René
//edit
It looks like it has to do with the .Value When I only ask for the Property.Name there is no error. Is it possible that there are properties without a value set...? Edited by: PolemEngineering on Feb 26, 2010 8:55 AM
With a simple code I retrieve all PropertySets and their Properties.
{code}
Option Explicit
Public Sub AllPropSetsAndProps()
Dim oPropSet As PropertySet
Dim oProp As Property
For Each oPropSet In ThisApplication.ActiveDocument.PropertySets
Debug.Print oPropSet.DisplayName & " Count: " & oPropSet.Count
For Each oProp In oPropSet
Debug.Print " '" & oProp.Name & "' = '" & oProp.Value & "'"
Next
Next
End Sub
{code}
In a testpart I used this code, and it works. Now I copy past it to another document and then I get an error.
Run-time error '91'
Object variabele or With block variable not set
I get this error halfway executing the code. Everytime the code end on the same property
{code}
'Catalog Web Link' = ''
{code}
The next property should be:
{code}
'Part Icon' = '0'
{code}
The weird part is that when I create a new document holding the Shift + Ctrl buttons the error don't show up.
Is there anyone who can tell me wat is going wrong here..
thnx in advance,
René
//edit
It looks like it has to do with the .Value When I only ask for the Property.Name there is no error. Is it possible that there are properties without a value set...? Edited by: PolemEngineering on Feb 26, 2010 8:55 AM
René van der Starre