02-23-2017
02:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
02-23-2017
02:32 AM
Hello there,
I'm trying to access some material properties but i'm stuck..
I want to change values for these fields. ( see image )
I used this piece of code to access the assetvalue but I cant find a way to set the value of a assetvalue (very confusing I know...
Dim oAssetLib As AssetLibrary
oAssetLib = _invApp.AssetLibraries.Item("MaterialLibrary")
Dim oAsset As Asset
oAsset = oAssetLib.MaterialAssets.Item(1)
For Each oValue As AssetValue In oAsset
Debug.Print(oValue.Name & ": " & oValue.ValueType.ToString)
Next
This resulted in the output.
AssetLibID: kAssetValueTypeString physmat_Comments: kAssetValueTypeString physmat_Cost: kAssetValueTypeString physmat_Keynote: kAssetValueTypeString physmat_Keywords: kAssetValueTypeString physmat_Label: kAssetValueTypeString physmat_Manufacturer: kAssetValueTypeString physmat_Mark: kAssetValueTypeString physmat_Model: kAssetValueTypeString physmat_Type: kAssetValueTypeChoice physmat_URL: kAssetValueTypeString physmat_aspects: kAssetValueTypeReference physmat_class: kAssetValueTypeString
But how can I Set the string value for example "physmat_Cost"? I can't see anything in the API for this?
AssetValue Object
Description The AssetValue object represents a specific value within an asset. The AssetValue class is the base class for the various types of asset values.
| Name | Description |
| Application | Returns the top-level parent application object. When used the context of Inventor, an Application object is returned. When used in the context of Apprentice, an ApprenticeServer object is returned. |
| DisplayName | Gets the name of this value as seen in the Material or Appearance Browser. This can change based on the current Inventor language. |
| IsReadOnly | Gets the boolean flag that indicates if this asset value is read-only. If True any attempted edits will fail. |
| Name | Gets the key name of the value. This name will remain constant for all languages and is the name used as input to the Item property or the Asset object. |
| Parent | Read-only property that returns the parent Asset object. |
| Type | Read-only property returning kAssetValueObject indicating this object’s type. |
| ValueType | Read-only property that returns the data type that the Value property for this AssetValue object will return. |
Please kudo if this post was helpfull
Please accept as solution if your problem was solved
Inventor 2014 SP2
Solved! Go to Solution.