How to select the Cross Hatch filter in API

ngnam1988
Advocate
Advocate

How to select the Cross Hatch filter in API

ngnam1988
Advocate
Advocate

Dears,

I'm trying working with Cross Hatch in Drawing View. Please help me what's the SelectionFilterEnum Enumerator for selection Cross Hatch only?

ngnam1988_1-1707676021366.png

 

ngnam1988_0-1707675887216.png

Thanks!

0 Likes
Reply
371 Views
4 Replies
Replies (4)

WCrihfield
Mentor
Mentor

Hi @ngnam1988.  There is no SelectionFilterEnum variation that will allow you to select the individual hatch regions within a drawing view.  There does however seem to be a manual filter for them, which is curious.  There have been a few forum topics in the past year or two about this.  Below are two related links, but there are more out there.

https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-quot-edit-hatch-pattern-quot-in... 

https://forums.autodesk.com/t5/inventor-programming-ilogic/change-hatch-by-pick/m-p/12394233 

Most postings I saw have the user picking he view itself, then iterating through the hatch stuff within that view by code, one way or another.  But I believe I saw at least one forum topic in which a user developed a custom workaround way to allow a user to select one, without using that Pick function.  It was fairly advanced code that included using custom event handers.  Seems to me like @Michael.Navara was involved with that post, but I do not recall where that link was.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

ngnam1988
Advocate
Advocate
0 Likes

WCrihfield
Mentor
Mentor

@ngnam1988 Yes, to a certain degree.  But those other settings, like what you are showing in your image above, and what I am showing information for below, will not stay in effect when using either the pre-select method, or when using the Pick function when using an iLogic rule.

Following are two direct properties of the DrawingDocument object, which allow similar settings to what you commonly see in the quick access bar of a drawing.

DrawingDocument.SelectionPreferences 

DrawingDocument.SelectionPriority 

The SelectionPriority is fairly basic, using a variation of the SelectionPriorityEnum as its value.

The SelectionPreferences is more in depth, allowing specific ObjectTypeEnum variation inputs.  But as I mentioned, those settings may effect manual user interactions within the visible user interface, but do not seem to carry over into what we do by code within iLogic rules.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Michael.Navara
Advisor
Advisor

In my opinion there is no way, how to select hatches and do something useful with them. Because some API functionality is missing.

 

If you try to select hatches and look in to the selectSet, you can see there is selected items count = 1, but Item1 is Nothing. If you select something useful (drawing curve for example) you can obtain them from Item1.

 

 

2024-02-13_11-51-14.png

 

EDIT

As @WCrihfield mentions above, similar issue is with WeldSymbols. WeldSymols doesn't have according SelectionFilterEnum value, but can be obtained from selectSet.

 

Hatches can be obtained only from DrawingView.HatchRegions Property