Hello!
Is there a possibility to access "Edit Hatch Pattern" in sectioned drawing view via iLogic?
I know how to access a specific drawing view, but not sure how to proceed:
ThisDrawing.Document.ActiveSheet.DrawingViews(1)
Probably view has to be "SectionDrawingView", but still I do not know how to access the "Hatch" inside it.
I am using Inventor 2020.5.
Best regards,
Rene Repina
Solved! Go to Solution.
Solved by brianM328K. Go to Solution.
Solved by WCrihfield. Go to Solution.
Hi @ReneRepina. Yes...in a way. There is a special, more specific type of view object just for section views, called 'SectionDrawingView', and it has a property called 'HatchRegions' (just added in Inventor 2022) which you can use to dig down into those areas. The URL's to the HatchRegions property and all the other related stuff is still messed up, so I can't provide links to those here. You will have to navigate down into them from the other link provided, if you want to.
Here is a fairly simple example of some iLogic code to get you started, if you have Inventor 2022.
oDDoc = ThisDrawing.Document
oSheet = oDDoc.ActiveSheet
For Each oView As DrawingView In oSheet.DrawingViews
If oView.ViewType = DrawingViewTypeEnum.kSectionDrawingViewType Then
Dim oSView As SectionDrawingView = oView
For Each oHatchR As DrawingViewHatchRegion In oSView.HatchRegions
'oHatchR.Angle
'oHatchR.BoundaryGeometries
'oHatchR.ByMaterial
'oHatchR.Color
'oHatchR.DoublePattern
'oHatchR.HatchAreas
'oHatchR.Layer
'oHatchR.LineWeight
'oHatchR.Pattern
'oHatchR.Scale
'oHatchR.Shift
'oHatchR.Visible
Next
End If
Next
Wesley Crihfield
(Not an Autodesk Employee)
Hi @WCrihfield !
Thanks for the information, this is what I needed!
I point it down to "SectionDrawingView", but got stuck there. I use Inventor 2020.5, so I will be unable to find and test as you suggested for now. We will upgrade to Inventor 2022 soon and I will try it then.
Thanks for the help!
Hi @ReneRepina
If anyone is still interested in drawing sketch hatch manipulation, you may like the attached code. Its something I have been working on.
(Note: this code will edit all hatches in that view. If any one knows how to select a small group of hatches only Please let me know)
Edited: 02/04/2024
Sorry I don't know where that first line came from. It has now been removed.
THANK YOU THANK YOU
I had to remark out the 1st line for it to work.
Hello @brianM328K .
Sorry for the late reply.
Thank you for putting efford into this code and sharing it.
We are still interested. I did not test it yet though. Maybe I will do it soon.
As for your case "select a small group of hatches", maybe you can try to filter them out by checking how big a part is in sketch compared to other parts. This is just an idea from top of my head, but I think code can be pretty complex to achieve that.
Best regards,
Rene Repina
Can't find what you're looking for? Ask the community or share your knowledge.