iLogic and hatching scale

iLogic and hatching scale

fridtjofZM5ME
Collaborator Collaborator
884 Views
6 Replies
Message 1 of 7

iLogic and hatching scale

fridtjofZM5ME
Collaborator
Collaborator

Is there some way to access the hatching in the API? I would very much like to be able to use a "for each"-loop to to set the scale of the hatching equal to 1/<INITIALVIEWSCALE> in any view featuring hatching. Ideally I'd like to do this in Styles, but there is no way of accessing the <INITIALVIEWSCALE> there as far as I know.

0 Likes
885 Views
6 Replies
Replies (6)
Message 2 of 7

dutt.thakar
Collaborator
Collaborator

@fridtjofZM5ME 

I think editing hatching in section views (changing scale, angle etc.) in drawing environment is not exposed in API. You can hide/show the hatching.

 

Although you can create your own sketch hatch region using API and change its scale etc. See this SketchHatchRegion object if you want to go that way.

 

Hope this will help you. 

 

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


Regards,
Dutt Thakar
LinkedIn
0 Likes
Message 3 of 7

brianM328K
Enthusiast
Enthusiast

Hi All

 

Has anyone found a solution to this? As I would also like to select some or all hatches and change the angle of rotation and scale factor.

 

Regards Brian

0 Likes
Message 5 of 7

WCrihfield
Mentor
Mentor

Link to response to same inquiry in another forum post:

https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/access-hatch-angle-through-i-logic/m... 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 6 of 7

brianM328K
Enthusiast
Enthusiast

Thanks for the response.
However it does not want to work for me, I'm running 2024 and I get a load of:-
'let' and 'set' assignments are no longer supported. statements pop up.

By removing the 'set' part of the program it will run. 

I'm not a good programmer and  am not sure how this would allow me to edit the scale or rotation angle of existing hatches?

0 Likes
Message 7 of 7

WCrihfield
Mentor
Mentor

Hi @brianM328K.  Those 'API Sample' examples are all in VBA, not in iLogic.  The 'Set' keyword is used in VBA when setting the value of an object type variable (not used for String, Integer, Double, and similar data types), but it is not used by iLogic (which uses vb.net).  If you want to run that API sample code from an iLogic rule, you will have to get rid of all the 'Set' keywords.  There are other differences between the two also, but none of the other differences are an issue in that specific example.  Plus, that API sample is dealing with hatching within a sketch, not the hatching within a drawing view.  However, you can create a DrawingSketch that is associated with a DrawingView, then project some of the view's geometry into the sketch, then add some hatching to that sketch, if you wanted.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes