Placing a SurfaceTexture Symbol with iLogic

Placing a SurfaceTexture Symbol with iLogic

harvey_craig2RCUH
Advocate Advocate
544 Views
3 Replies
Message 1 of 4

Placing a SurfaceTexture Symbol with iLogic

harvey_craig2RCUH
Advocate
Advocate

I'm very close with this one, so this should be easy...

 

I wish to place a surface texture symbol on a geometry intent. I have managed to achieve this, but I can't find where to adjust the A' property. I need A' = 1.6 in this instance. This is the rule I have written:

'Document setup.
Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDoc.ActiveSheet
Dim oView As DrawingView = ThisDoc.Document.Sheets.Item(1).DrawingViews.Item(1)
Dim viewname As String = ThisDoc.Document.Sheets.Item(1).DrawingViews.Item(1).Name 'get view name
Dim MainSheet = ThisDrawing.Sheets.ItemByName("Sheet:1")
Dim VIEW1 = MainSheet.DrawingViews.ItemByName(viewname)

'Get Intent.
Dim SealPoint2 As GeometryIntent = VIEW1.GetIntent("SealFace", PointIntentEnum.kMidPointIntent, nearPoint := VIEW1.SheetPoint(0, 1))

'Add it to collection as required by SurfaceTextureSymbol definition.
Dim mySurfaceTextureCollection As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
mySurfaceTextureCollection.Add(SealPoint2)

'Setting up symbol and placing it.
Dim mySymbolDef As SurfaceTextureSymbolDefinition = oSheet.SurfaceTextureSymbols.CreateDefinition
mySymbolDef.SurfaceTextureType = kMaterialRemovalRequiredSurfaceType
Dim oSymbol As SurfaceTextureSymbol = oSheet.SurfaceTextureSymbols.AddByDefinition(mySurfaceTextureCollection, mySymbolDef)

 When you run it works:

harvey_craig2RCUH_0-1728474822741.png

I just require A' = 1.6 on it. I've attached the files.

 

Thanks,

Harvey

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

HermJan.Otterman
Advisor
Advisor
Accepted solution

Hello Harvey,

 

add one line:

 

oSymbol.MaximumRoughness = "1.6"

 here are some other properties:

HermJanOtterman_0-1728481250117.png

 

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


0 Likes
Message 3 of 4

Stephane_Hemberger
Participant
Participant

Thanks to your posts,
I was able to represent the surface texture symbol on the desired surface in the desired view of my drawing.

However, now when I try to add the A´ roughness value to the symbol or place the symbol in a specific location using the following code:

oSymbol.MaximumRoughness = ("0.8")
oSymbol.Position = textPoint

(where textPoint is a defined 2D point that’s positioned in the view and also used in other parts of the code),

it seems as if these two lines are ignored/not applied and I don’t receive any error message.

Does anyone have any idea how to resolve this?

Thank you in advance for any suggestions.

Best regards,
Stéphane Hemberger

 



0 Likes
Message 4 of 4

HermJan.Otterman
Advisor
Advisor

hi,

in Harvey's code there is a line: mySurfaceTextureCollection.Add(SealPoint2), this should be the lastpoint in the list.

before this line add one or more of these lines: 

mySurfaceTextureCollection.Add(ThisApplication.TransientGeometry.CreatePoint2d(10, 10))

where 10,10 is a coordinate in cm

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan