Ilogic Emboss / Engrave

Ilogic Emboss / Engrave

yohansampaio
Explorer Explorer
239 Views
3 Replies
Message 1 of 4

Ilogic Emboss / Engrave

yohansampaio
Explorer
Explorer

Good afternoon,

 

I need to create an iLogic rule to generate an emboss feature with an internal depth of 0.1 mm on the part.

In this case, I already have a rule that creates the sketch, and this sketch is named "Text Marking Sketch".

So, I need a rule that finds the sketch named "Text Marking Sketch" and uses it to create the emboss with a depth of 0.1 mm on the part where the rule is executed.

The sketch I create is a text object, as shown in the attached image.

One important detail is that the marking will always be done on the flat pattern view of a sheet metal part.

Text Marking Sketch.pngmarcação.png

 

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

Curtis_Waguespack
Consultant
Consultant

Hi @yohansampaio, welcome to the community.

You can use this example. It will create an extrude feature with cut text on the flat pattern.

Hope that helps,

Curtis

 

' Get the active part document (sheet metal part)
Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument
' Get the sheet metal component definition
Dim oSheetMetalDef As SheetMetalComponentDefinition = oPartDoc.ComponentDefinition

Dim FeatureName As String = "My Engraved Feature"
Try:oSheetMetalDef.FlatPattern.Features.ExtrudeFeatures.Item(FeatureName).Delete: Catch: End Try

' Ensure we're working with the flat pattern
' Switch to flat pattern view if not already there
If Not oSheetMetalDef.HasFlatPattern Then oSheetMetalDef.FlatPattern.Edit

' Find the existing sketch named "Text Marking Sketch"
Dim oSketch As PlanarSketch =  oSheetMetalDef.FlatPattern.Sketches.Item("Text Marking Sketch")

' Create profiles from the sketch (text objects)
Dim oPaths As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
oPaths.Add(oSketch.TextBoxes.Item(1))

oProfile = oSketch.Profiles.AddForSolid(False, oPaths)

Dim oDepth As String = 0.01

' Extrude the text.
Dim oExtrudeDef As ExtrudeDefinition = oSheetMetalDef.FlatPattern.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, kCutOperation)
oExtrudeDef.SetDistanceExtent(oDepth, kNegativeExtentDirection)
Dim oExtrude As ExtrudeFeature = oSheetMetalDef.FlatPattern.Features.ExtrudeFeatures.Add(oExtrudeDef)
oExtrude.Name = FeatureName

 

EESignature

0 Likes
Message 3 of 4

Curtis_Waguespack
Consultant
Consultant
Accepted solution

@MjDeck, If you have some time can you take a look at the attached example, and let me know what would be needed to get the AddEngraveFromFace method for EmbossFeatures to work? I could not find a working example, and I'm not understanding why this example will not work.
Thanks in advance! 

Curtis

 

' Get the active part document (sheet metal part)
Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument
' Get the sheet metal component definition
Dim oSheetMetalDef As SheetMetalComponentDefinition = oPartDoc.ComponentDefinition

' Ensure we're working with the flat pattern
' Switch to flat pattern view if not already there
If Not oSheetMetalDef.HasFlatPattern Then oSheetMetalDef.FlatPattern.Edit

' Find the existing sketch named "Text Marking Sketch"
Dim oSketch As PlanarSketch =  oSheetMetalDef.FlatPattern.Sketches.Item("Text Marking Sketch")

' Create profiles from the sketch (text objects)
Dim oPaths As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
oPaths.Add(oSketch.TextBoxes.Item(1))

oProfile = oSketch.Profiles.AddForSolid(False, oPaths)

Dim oDepth As String = 0.1

' Create the emboss feature using the flat pattern
Dim oEmbossFeature As EmbossFeature
oEmbossFeature = oSheetMetalDef.FlatPattern.Features.EmbossFeatures.AddEngraveFromFace( oProfile, oDepth, PartFeatureExtentDirectionEnum.kSymmetricExtentDirection)

 

EESignature

0 Likes
Message 4 of 4

MjDeck
Autodesk
Autodesk
Accepted solution

Hi Curtis - the symmetric option is not supported in the UI or in the API. That's mentioned in the documentation.
It will work if you use PartFeatureExtentDirectionEnum.kNegativeExtentDirection or kPositiveExtentDirection.
I had some problems with kNegativeExtentDirection, but it worked when I reduced the depth. This worked:

Dim oDepth As String = "0.05 in"

 


Mike Deck
Software Developer
Autodesk, Inc.