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: 

Change values of several hatch patterns

8 REPLIES 8
Reply
Message 1 of 9
KOKAK
790 Views, 8 Replies

Change values of several hatch patterns

Necesito seleccionar varios patrones de sombreado en una vista en sección de dibujo y asignarles a todos los mismos valoresmediante VBasic pero no encuentro la manera de hacerlo. Por ejemplo, todos a 45 grados de ángulo y a 0,25 de escala. 

Perdonar por mi mal ingles.

 

 

I need to select various shading patterns in a section view drawing and assign
all the same settings using VBasic but can not find the way to go. For example, all
a 45 degree angle and scale to 0.25.

Forgive for my bad English.


8 REPLIES 8
Message 2 of 9
ekinsb
in reply to: KOKAK

Unfortuately there is not currently any API support to access the hatching that's created as the result of a section.  I don't know of any workarounds.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 3 of 9
Anonymous
in reply to: KOKAK

I would like to do the same!

Just like in AutoCAD.

Message 4 of 9
ACEDeSmedt
in reply to: KOKAK

Somebody found a workaround yet?

=================================
If this is the solution, push the solution button 😉 (and maybe some kudos)
Autodesk Product Design Suit - Ultimate edition (Subscription)
Message 5 of 9
^_^clovis^_^
in reply to: ACEDeSmedt

Hello,

I'm having the same issue with Inventor 2017.

Is there a "vba" way to rotate all hatches after a view has been rotated?

Thanks

Message 6 of 9
KOKAK
in reply to: ^_^clovis^_^

At the moment I do not see a solution since the inventor API does not give access to the subject of shading. But I have it among my main objectives.

 

Excuse my English from Google

 

De momento no le veo solución ya que el API de inventor no da acceso al tema de los sombreados. Pero lo tengo entre mis principales objetivos.

 

Perdone mi ingles de Google

Message 7 of 9
brianM328K
in reply to: KOKAK

Hi there its been a long time since the last post here.

Has anyone found a solution to this issue about batch rotating and scaling a hatch pattern yet ???

 

Kind Regards

 

Message 8 of 9

If you have Inventor 2022 or onwards this should do:

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

 

 the solution is from this post:
https://forums.autodesk.com/t5/inventor-programming-ilogic/accessing-quot-edit-hatch-pattern-quot-in...

Message 9 of 9

Hi @david_alcalde6P6BN. Thanks for your reply
 
 
I have since managed to put the bellow together.
However I would like the option to be able to select individual / a group of hatches to modify rather than the entire view.
 

Hello All

@cadman777 I have put together a code that will allow you to do the following.

First it asks you to select a view you would like to edit the hatching in, once you have picked a view the following pops up. (Note: this code will edit all hatches in that view)

 

brianM328K_0-1703157117607.png

 

brianM328K_1-1703157117624.png

 

brianM328K_2-1703157117581.png

 

brianM328K_3-1703157117603.png

 

I would like to be able to select a group of hatching to edit but am struggling to work that part out. Attached is the code if you want to use it.

I hope this is of help .

 

Sub Note 13/02/2024

I have attached a revised version of the code with enhanced user interface and features. You can now also adjust the hatch pattern.

brianM328K_0-1707836558794.png

 

 

Regards Brian.

 

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

Post to forums  

Autodesk Design & Make Report