PropertySets Failing to Access iProperties

PropertySets Failing to Access iProperties

richard.joseph.pollak
Advocate Advocate
616 Views
2 Replies
Message 1 of 3

PropertySets Failing to Access iProperties

richard.joseph.pollak
Advocate
Advocate

I am trying to compare expression values in my iProperties, but some of the default iProperties have been giving me trouble.

 

Does anyone know why I am getting an error?

 

 

oPropSet = ThisDoc.Document.PropertySets.Item("Design Tracking Properties")

MessageBox.Show(oPropSet.Item("Description").Expression)
MessageBox.Show(oPropSet.Item("Project").Expression)
MessageBox.Show(oPropSet.Item("Checked By").Expression)
'The following returns an error:
MessageBox.Show(oPropSet.Item("Eng. Approved By").Expression)

 

Here is the error:

 

Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
   at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
   at LmiRuleScript.Main()
   at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
   at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

 

0 Likes
Accepted solutions (1)
617 Views
2 Replies
Replies (2)
Message 2 of 3

pball
Mentor
Mentor
Accepted solution

It seems that isn't the correct item name. My cheat sheet shows "Engr Approved By".

 

Here is a copy of the iProperties list from an AU pdf I found.

 

Now that I think about it, I remember having this issue before because the label in the iProperties dialog do not match the item name in the API.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
Message 3 of 3

richard.joseph.pollak
Advocate
Advocate

 

oPropSet = ThisDoc.Document.PropertySets.Item("Design Tracking Properties")

search = True
i = 1
Do While search = True
	Try
		MessageBox.Show(oPropSet.Item(i).Name)
	Catch
		search = False
	End Try
	i = i + 1
Loop

 

I was able to trouble shoot using the rule above. I learned that the name of "Eng. Approved By" is actually "Engr Approved By".

Go figure! Hopefully if anyone else comes across this problem they will find this post.

0 Likes