Ilogic Script for Highlight Defind A-Side and set the appearance ?

Ilogic Script for Highlight Defind A-Side and set the appearance ?

willemTHLQC
Participant Participant
799 Views
2 Replies
Message 1 of 3

Ilogic Script for Highlight Defind A-Side and set the appearance ?

willemTHLQC
Participant
Participant

HLASIDE.png

Hello, I need some help using Ilogic the select Defind A-Side and the set a appearance  to it 

I want to use this for setting up Diamant/tear Plate type of materiaals  and have the other sides blank

 

Any one any ideas how to do this?

 

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

MjDeck
Autodesk
Autodesk
Accepted solution

Here's a sample:

Sub Main
	Dim partDoc As PartDocument = ThisDoc.Document
	Dim compDef As SheetMetalComponentDefinition = partDoc.ComponentDefinition

	If (compDef.HasFlatPattern) Then
		Dim flat = compDef.FlatPattern
		Dim foldedFace = flat.ASideFace.ASideFace
		If (foldedFace IsNot Nothing) Then
			For Each faceX As Face In flat.ASideFace.Faces
				'partDoc.SelectSet.Select(foldedFace)
				SetFaceColor(faceX, "Orange", partDoc)
			Next
		End If
	End If
End Sub

Sub SetFaceColor(face As Face, appearanceName As String, partDoc As PartDocument)
	Dim asset As Asset = Nothing
	Try
		asset = partDoc.Assets.Item(appearanceName)
	Catch
		Dim assetLib = ThisApplication.AssetLibraries.Item("314DE259-5443-4621-BFBD-1730C6CC9AE9")  '("Autodesk Appearance Library")
		asset = assetLib.AppearanceAssets.Item(appearanceName)
		asset = asset.CopyTo(partDoc)
	End Try
	'Logger.Info("Asset name = {0}", asset.DisplayName)
	face.Appearance = asset
End Sub

Mike Deck
Software Developer
Autodesk, Inc.

Message 3 of 3

willemTHLQC
Participant
Participant

Thank you MjDeck ,

this works great for me

0 Likes