Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Inventor API - Access section HATCH Edit with API

Khoa_NguyenDang
Advocate
Advocate

Inventor API - Access section HATCH Edit with API

Khoa_NguyenDang
Advocate
Advocate

Hi all guy 

I want to access the Hatch Edit with API like in the picture 

Khoa_NguyenDang_0-1609379197652.png

Does anybody know or have the experience to access Hatch Edit?

If someone knows, hope you can help me, thank you so much 

0 Likes
Reply
832 Views
5 Replies
Replies (5)

bradeneuropeArthur
Mentor
Mentor

Hi think that it is still not in the API!

 

https://forums.autodesk.com/t5/inventor-customization/create-hatch-in-a-sketched-region-in-a-drawing...

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations:

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: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 !

0 Likes

dutt.thakar
Collaborator
Collaborator

@Khoa_NguyenDang 

 

This part of Inventor API is not yet exposed I think to the users, as @bradeneuropeArthur has mentioned. I tried to find something in Inventor API help and what I found is we can just show/hide the hatching using DisplayHatching property in a view but can not change the angle.

 

On the other hand, if you can defined hatch angle from DrawingStandardStyle object, you can use PresetSectionHatchAngles property to set the angle.

 

Hope this will be helpful

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes

TomaszKn
Enthusiast
Enthusiast

Does anyone know if it is planned to be added to the API of the option to modify it?

 

Regards

Tomasz

0 Likes

dutt.thakar
Collaborator
Collaborator

@TomaszKn 

 

Add it to Idea station and Autodesk may consider.

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes

lmc.engineering
Advocate
Advocate

Inventor 2022 seems to have this available. At least I am able to modify via API, as below:

 

Dim oDoc As DrawingDocument = oSheet.Parent
Dim oHR As DrawingViewHatchRegion
Dim HatchPattern As String = "Solid" 'Change as required.

For Each oHR In oView.HatchRegions
	'If you need to gain access to the part:
	'Dim sb As SurfaceBody = oHR.SurfaceBody
	'Dim HatchOcc As ComponentOccurrence = sb.Parent
	'Dim HatchDoc As PartDocument = HatchOcc.Definition.Document
	
	'Boolean to set to Material, if required.
	'oHR.ByMaterial = False

	oHR.Pattern = oDoc.DrawingHatchPatternsManager.Item(HatchPattern)

	Dim HatchColor As Color
	HatchColor = g_InvApp.TransientObjects.CreateColor(100, 100, 100)
	oHR.Color = HatchColor
	oHR.Angle = 45
	oHR.LineWeight = 0.1
Next
0 Likes