ilogic Thicken/offset command

ilogic Thicken/offset command

manu.marjanen
Advocate Advocate
236 Views
1 Reply
Message 1 of 2

ilogic Thicken/offset command

manu.marjanen
Advocate
Advocate

How to create a new solid for each surface with the Thicken -command?

And for each solid a name with running numbering, for example Plate-1, Plate-2, Plate-3...

 

manumarjanen_0-1664357193378.png

 

0 Likes
Accepted solutions (1)
237 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor
Accepted solution

Hi @manu.marjanen.  Here is an iLogic rule you can try out for this task.  I did not have a file to test this on, so I have not tested it yet, but it seems fairly simple.

If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kPartDocumentObject Then
	MsgBox("A Part Document must be active for this rule to work. Exiting.", vbCritical, "")
	Exit Sub
End If
Dim oPDoc As PartDocument = ThisDoc.Document
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oThknFeats As ThickenFeatures = oPDef.Features.ThickenFeatures
Dim oWSs As WorkSurfaces = oPDef.WorkSurfaces
If oWSs.Count = 0 Then Exit Sub
Dim oBaseName As String = "Plate-"
Dim oInt As Integer = 1
For Each oWS As WorkSurface In oWSs
	Dim oThknFeat As ThickenFeature = oThknFeats.Add(oWS, _
	".25 in", PartFeatureExtentDirectionEnum.kPositiveExtentDirection, _
	PartFeatureOperationEnum.kNewBodyOperation)
	Try
		oThknFeat.SurfaceBodies.Item(1).Name = oBaseName & oInt
		oInt = oInt + 1
	Catch
		MsgBox("Error trying to rename new Body, created by the Thicken feature.", vbExclamation, "")
	End Try
Next

If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes