Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to select the Cross Hatch filter in API

4 REPLIES 4
Reply
Message 1 of 5
ngnam1988
275 Views, 4 Replies

How to select the Cross Hatch filter in API

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!

Tags (3)
4 REPLIES 4
Message 2 of 5
WCrihfield
in reply to: ngnam1988

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)

Message 3 of 5
ngnam1988
in reply to: WCrihfield

Message 4 of 5
WCrihfield
in reply to: ngnam1988

@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)

Message 5 of 5
Michael.Navara
in reply to: ngnam1988

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 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report