Inventor update style in all views on drawing

Inventor update style in all views on drawing

Lukasz.Dudkowski
Enthusiast Enthusiast
1,090 Views
5 Replies
Message 1 of 6

Inventor update style in all views on drawing

Lukasz.Dudkowski
Enthusiast
Enthusiast

Hello,

 

I need iLogic macro with help me to change style standard on already created views on the drawing.

 

Example: I have old drawing with old style standard. Right now I need to click on each dimension\view etc and select current style. It's time consuming.

 

Is this possible to create iLogic macro with update all views on the drawing to one style standard ?

 

0 Likes
1,091 Views
5 Replies
Replies (5)
Message 2 of 6

Ralf_Krieg
Advisor
Advisor

Hello

 

All of the used styles are defined in one active norm. Set up a norm with your styles and set this norm in document options as active. Don't manual override this automatism in general.

Or if this is not your current problem, explain in detail with some screenshots please.


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 3 of 6

Lukasz.Dudkowski
Enthusiast
Enthusiast

My problem is how to change a style for example fo all dimensions on the drawing to newst style from my templates ?

How I can do this automatically ?

 

That is why my ID was to use some iLogic rule with will change all styles for dimensions on the drawing to style cold X, all styles for weld marks to styl X, etc.

 

Right now I need to do this one by one what is time consuming.

 

Example showed in attachment.  I have dimension with was done already and when I try to add new once this is according to newest style what is correct. I need help from iLogic to update all dimensions\weld symbols\text annotations etc. on the drawing to newest style. 

 

Inventor_R5 - old style

Nederman_25 - actuall style

 

0 Likes
Message 4 of 6

Ralf_Krieg
Advisor
Advisor

Hello

 

The standard way is to have a style library. Every drawing get's it styles from there and if you modify a style (first local in the current open drawing and transfer the modified style to the library) all drawings opened later will show a message that local styles are not up to date. Updating styles from library transfer the changes to your local styles in the drawing and updates existing dimensions and so on.

The norm is like a bag where you can collect all the styles you need together. With more then one norm, you have multiple bags full of styles and decide which one to choose for your current needs. Just with "one click".

 

The whole theme Drawing styles creating, handling and so on can easily fill up to a day in a trainig course.

Read the documentation to this theme and try it out. But make copies of your originals before and save them.


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 5 of 6

Lukasz.Dudkowski
Enthusiast
Enthusiast

I know but you explain how styles are working without solving my issue.

 

Then I repeat what I need.  I need to have iLogic macro with change dimension style from existing in document to defined by user in style library.

0 Likes
Message 6 of 6

Ralf_Krieg
Advisor
Advisor

Hello

 

I believe you don't know in detail how styles are working. Anyway, a simple example for changing some styles. It's not complete for all drawing annotations. It assumes that the style exist in the library or local in document.

Dim oTrans As Transaction = ThisApplication.TransactionManager.StartTransaction(ThisDoc.Document,"Update Styles")

Try
	Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
	Dim oStylesMgr As DrawingStylesManager = oDrawDoc.StylesManager

	Dim oNewStyle As Inventor.DimensionStyle
	For Each oNewStyle In oStylesMgr.DimensionStyles
	    If oNewStyle.Name = "Nederman 25" Then Exit For 
	Next

	If oNewStyle.StyleLocation = kLibraryStyleLocation Then
	    oNewStyle.ConvertToLocal
	End If

	Dim oSheet As Sheet
	For i = 1 To oDrawDoc.Sheets.Count
	    oDrawDoc.Sheets(i).Activate
		
	'Example for some Dimension styles
	    Dim oBaseLineDimSet As BaselineDimensionSet
	    For Each oBaseLineDimSet In oDrawDoc.ActiveSheet.DrawingDimensions.BaselineDimensionSets
	        oBaseLineDimSet.Style = oNewStyle
	    Next
	    Dim oChainDimSet As ChainDimensionSet
	    For Each oChainDimSet In oDrawDoc.ActiveSheet.DrawingDimensions.ChainDimensionSets
	        oChainDimSet.Style = oNewStyle
	    Next
	    Dim oOrdinateDimSet As OrdinateDimensionSet
	    For Each oOrdinateDimSet In oDrawDoc.ActiveSheet.DrawingDimensions.OrdinateDimensionSets
	        oOrdinateDimSet.Style = oNewStyle
	    Next
	    Dim oOrdinateDim As OrdinateDimension
	    For Each oOrdinateDim In oDrawDoc.ActiveSheet.DrawingDimensions.OrdinateDimensions
	        oOrdinateDim.Style = oNewStyle
	    Next
	    Dim oGeneralDim As GeneralDimension
	    For Each oGeneralDim In oDrawDoc.ActiveSheet.DrawingDimensions.GeneralDimensions
	        oGeneralDim.Style = oNewStyle
	    Next
		
	'Example for Drawing notes
	    Dim oLeaderNote As LeaderNote
	    For Each oLeaderNote In oDrawDoc.ActiveSheet.DrawingNotes.LeaderNotes
	        oLeaderNote.DimensionStyle = oNewStyle
	    Next
	Next
Catch
Finally
	oTrans.End
End Try

R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes