iLogic code for Hinge hole command for Inventor

iLogic code for Hinge hole command for Inventor

Anonymous
Not applicable
401 Views
2 Replies
Message 1 of 3

iLogic code for Hinge hole command for Inventor

Anonymous
Not applicable

I want iLogic code for Hinge hole command for Inventor

Drill the Hinge hole into the side of cabinate at door front

0 Likes
402 Views
2 Replies
Replies (2)
Message 2 of 3

bradeneuropeArthur
Mentor
Mentor

Could you be more specific?

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 3

Anonymous
Not applicable

Code behaves as drills at center of the sheet metal
I want Drill on the side of cabinate at door.

Dim oSheetMetalDoc As PartDocument
oSheetMetalDoc = ThisApplication.ActiveEditDocument

' a reference to the component definition.
Dim oCompDef As SheetMetalComponentDefinition
oCompDef = oSheetMetalDoc.ComponentDefinition

' a reference to the sheet metal features collection.
Dim oSheetMetalFeatures As SheetMetalFeatures
oSheetMetalFeatures = oCompDef.Features

Dim oFace As Face

'Keep Selecting Faces, Hit Esc to finish
Do
    oFace = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities, "Select a face")
    If Not oFace Is Nothing Then 
        Exit Do
    End If
Loop While Not oFace Is Nothing

' Get the outer loop of the face.
Dim outerLoop As EdgeLoop
For Each outerLoop In oFace.EdgeLoops
    If outerLoop.IsOuterEdgeLoop Then
        Exit For
    End If
Next

' Create a workpoint at the edge mid-point
Dim oWorkPoint As WorkPoint
oWorkPoint = oCompDef.WorkPoints.AddAtCentroid(outerLoop)

Dim oPointPlacement As PointHolePlacementDefinition 
oPointPlacement = oCompDef.Features.HoleFeatures.CreatePointPlacementDefinition(oWorkPoint,oFace)

' Create the hole feature, 0.5 cm dia
Call oCompDef.Features.HoleFeatures.AddDrilledByThroughAllExtent( _
                        oPointPlacement, 0.5, kPositiveExtentDirection)
'turn off workpoint
oWorkPoint.Visible = False
0 Likes