Reg- Part Sketch Points

Reg- Part Sketch Points

sundaram1087
Advocate Advocate
349 Views
2 Replies
Message 1 of 3

Reg- Part Sketch Points

sundaram1087
Advocate
Advocate

Hi

 I have created the sketch with 10 Points. From that i have created the hole feature from that

 

Now i want to edit the hole feature i.e out of 10 i want to switch off 2 points from creating the hole feature

 

Depending upon the requirement i will switch off the points from the hole feature.

 

Can able to provide the some sample code how to proceed on this

 

Regards

Shunmugasundaram

 

 

 

 

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

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Have you created a sketch with:

  • Center point in it
  • Or With Work-Points on it
  • Are these Points patterned or not

Could you give us an example?

 

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

Message 3 of 3

JelteDeJong
Mentor
Mentor

if you know that you need holes (or any other feature) but dont need them in evry situation, then you could also create them (like you would normaly) and suppress the holes that you dont need. In that case you dont need to write a compicated rule that create holes. In this example i have 4 holes that need to be suppressed or not depending of the value of the parameter "Length".

Dim doc As PartDocument = ThisDoc.Document
Dim holeFeatures As HoleFeatures = doc.ComponentDefinition.Features.HoleFeatures

Dim hole1 As HoleFeature = holeFeatures.Item("Hole1")
Dim hole2 As HoleFeature = holeFeatures.Item("Hole2")
Dim hole3 As HoleFeature = holeFeatures.Item("Hole3")
Dim hole4 As HoleFeature = holeFeatures.Item("Hole4")

If (length > 10) Then
    hole1.Suppressed = True
    hole2.Suppressed = False
    hole3.Suppressed = True
    hole4.Suppressed = True
ElseIf (length < 5) Then
    hole1.Suppressed = True
    hole2.Suppressed = False
    hole3.Suppressed = False
    hole4.Suppressed = True
Else
    hole1.Suppressed = True
    hole2.Suppressed = True
    hole3.Suppressed = True
    hole4.Suppressed = True
End If

There is also an easyer solution if your conditions are very simple. (like suppress hole if "Length" > 10 and in all other cases you need to see it.) Afther you created the hole (or any other feature) right click on it and select "Properties". In the forum select suppress "if" and set your condition. If you do this then you dont need to write any code.

suppress feature.png

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes