Changing Appearance Scale with Ilogic

Changing Appearance Scale with Ilogic

gcoombridge
Advisor Advisor
620 Views
2 Replies
Message 1 of 3

Changing Appearance Scale with Ilogic

gcoombridge
Advisor
Advisor

Hi All,

 

I've been playing with altering appearance properties with ilogic for some parts I'm authoring to CC. When they are saved as custom they revert back to the standard material library values. I've pieced together changing RGB colour values but am having issued with texture scales.

 

I've been using this post and replacing the rotation for scale:

https://adndevblog.typepad.com/manufacturing/2015/11/texture-rotation-in-the-inventor-api.html

 

The example file works well with timbers and many others but not all appearances. The specific one I was looking to change was "Autodesk Appearance Library\Galvanized". Using the API help sample code to draw down all of the appearance information it seems 'Galvanized' (and other appearances) does not have the asset value texture_RealWorldScaleX despite having a texture present.

 

The attached screenshot shows the texture scale can be changed in the UI. Also attached is the Galvanized output from the appearance info VBA script in the sample file.image.png

 

Can any of you provide some insight into this?  

 

Thanks,

Glenn

 

 

 

 

 

 

 

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
0 Likes
621 Views
2 Replies
Replies (2)
Message 2 of 3

gcoombridge
Advisor
Advisor

This was the code I had adapted:

Case "Galv"
'get the galv texture from the Autodesk Lib because it looks cooler
	Dim oAssetLib As AssetLibrary = ThisApplication.AssetLibraries.Item("Autodesk Appearance Library")
	ThisApplication.ActiveAppearanceLibrary = oAssetLib
	iProperties.PartColor = "Galvanized"
	
	Dim oAppearance As Asset = oDoc.ActiveAppearance
	Dim oValue As AssetValue

	For Each oValue In oAppearance
	If oValue.ValueType = AssetValueTypeEnum.kAssetValueTextureType Then
        Dim oTextureAssetValue As TextureAssetValue = oValue
        Dim oTexture As AssetTexture = oTextureAssetValue.Value
        If oTexture.Item("unifiedbitmap_Bitmap").value <> "" Then
			  oTexture.Item("texture_RealWorldScaleX").value = 25
		End If
		End If
Next

But as no 'unifiedbitmap_Bitmap' is listed it goes nowhere...

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
0 Likes
Message 3 of 3

johnsonshiue
Community Manager
Community Manager

Hi! I am sorry the issue has not been resolved. It seems that each appearance style needs to be kicked a bit. I am able to update the thumbnail by changing any field in the appearance style -> Ok. Then change it back -> Ok. I am wondering if using an iLogic rule to do the same would work too.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes