CustomProperty.BinaryData.1.vbs Example

Applies To

CustomProperty.BinaryData property

Description

This example demonstrates how the BinaryData property could be used to roll back changes that a user might have made on a custom property set. The property set is shown as a modal dialog, with OK/CANCEL buttons and if the user clicks Cancel we restore the property set values back to their original values.

Code

dim oRoot, oPropSet
' Set up the example
set oRoot = Application.ActiveProject.ActiveScene.Root
set oPropSet = oRoot.AddProperty("Custom_parameter_list", , "ExamplePSet")
SIAddCustomParameter oPropSet, "TestVal", siDouble, 5, 0, 10
call ModalInspectCustomProperty(oPropSet)
' Convenience routine to do the work
sub ModalInspectCustomProperty( in_oPropertySet )
	dim strOriginalValues
	strOriginalValues = in_oPropertySet.BinaryData
	' If cancel is pressed then Inspect object will fail.  This "on error" 
	' statement says that we want to handle the error rather than have the 
	' whole script fail.
	on error resume next
	InspectObj in_oPropertySet, , , siModal
	if ( err <> 0 ) then
		' User pressed cancel - roll back any changes that they made
		in_oPropertySet.BinaryData = strOriginalValues
	end if
end sub

Related Examples

CustomProperty.BinaryData.2.js

Keywords

CustomProperty BinaryData


Autodesk Softimage 2011