Style and Standard Editor

Style and Standard Editor

kv5053545
Advocate Advocate
1,229 Views
10 Replies
Message 1 of 11

Style and Standard Editor

kv5053545
Advocate
Advocate

Hello, I am working with a .dwg file I have been trying to edit the dimensions of the view but I have not succeeded, I tried to edit the template but when the view is added to the template the values of the style editor are updated and here my question, is it possible that through ilogic I can modify the values of the dimension directly from the style editor so that these always remain in this way (attached image).image.png

0 Likes
Accepted solutions (1)
1,230 Views
10 Replies
Replies (10)
Message 2 of 11

WCrihfield
Mentor
Mentor

Hi @kv5053545.  The quick/simple answer is yes, we can access those dimension style settings through Inventor API (and iLogic rule code).  However, after looking at the image you posted, it looks like your style library is ReadOnly, so trying to set these settings by code may fail, if trying to edit the original style within the style library.  However, there is usually a 'local' (within that document) copy of the style, so that the objects within that document can use it.  You may be able to make edits to that style.

Here is some example iLogic rule code:

Sub Main
	If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then Exit Sub
	Dim oDDoc As DrawingDocument = ThisDoc.Document
	Dim oStMgr As DrawingStylesManager = oDDoc.StylesManager
	Dim oDimStyles As DimensionStylesEnumerator = oStMgr.DimensionStyles
	Dim oDimStyle As DimensionStyle = oDimStyles.Item("Default (ANSI)")
	oDimStyle.ArrowheadType = ArrowheadTypeEnum.kFilledArrowheadType
	oDimStyle.ArrowheadSize = 0.140
	oDimStyle.ArrowheadHeight = 0.040
	oDimStyle.Extension = 0.180
	oDimStyle.OriginOffset = 0.063
	oDimStyle.Gap = 0.000
	oDimStyle.Spacing = 0.000
	oDimStyle.PartOffset = 0.394
	
End Sub

If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 11

WCrihfield
Mentor
Mentor

It is difficult to judge by what little you said about this situation, but my guess is that you may simply need to set a different DimensionStyle as the default one, and make sure that DimensionStyle that you set as default has all the settings the way you want them.  Then all new dimensions you create within that drawing will conform to that default style...unless you specifically set a different dimension style for some as you create them.  If you want to quickly change a lot of already existing dimensions' styles to match another existing dimension style, then you can select all of the dimensions on the sheet, then on the Annotate tab, make sure the Format panel is showing, and if it already is, select a different dimension style to set all those selected dimensions to.  If you are not familiar with how to set which dimension style is the default one, we may be able to help you set that up.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 11

Frederick_Law
Mentor
Mentor

@kv5053545 wrote:

I tried to edit the template but when the view is added to the template


View add to Template?

Or View add to new drawing created from Template?

Which template did you edit?  What is the file name?

0 Likes
Message 5 of 11

kv5053545
Advocate
Advocate

Of course, if you can help me with the creation of a default dimension style, I would be grateful.

0 Likes
Message 6 of 11

WCrihfield
Mentor
Mentor
Accepted solution

Sorry for the delay.  Lots of stuff going on today, and this is something that may take a long time to describe.

I believe the control for whether your drawing styles library is Read/Write vs ReadOnly is within the Project settings.  To access the Project settings, click on your File tab, then go down and click on Manage, then over and click on Projects.  The 'active' project will be listed with a checkmark next to it.  Those settings within the 'active' project will be ReadOnly if there are any Inventor documents open, so you may need to close all documents first, without closing Inventor.  Then while that Projects dialog is open, and the active project is selected in the top list, there will be a property named "Use Style Library = ", that you may want to set to Read-Write, so that you will be able to make the needed changes.  Then, if everything else there looks good, you can click Apply, Save, & Done buttons.

 

Now go to the Manage tab, and open the Styles Editor.  The first items listed at the top of the list on the right are the 'standard' styles.  Those are the top level styles, that hold all other types of styles, and all the styles that will be default while that standard is active.  If you go to the Tools tab (outside of this dialog), and click on the Document Settings, you will see a drop-down control on one of the tabs for setting which 'standard' is the active one for the drawing.  Within that 'standard' style is another type of style just for setting 'defaults'.  You will see them on the left list also.  One of those will be the one that the main 'standard' is using.  While the main standard style is selected, if you look to the right, you will see a tab for setting which 'defaults' style it should use.  And if you select that 'object defaults' style in the list on the left, you can control which individual styles will be used for which specific situations.  And if you need to, you can create more of the individual types of styles, and set a different one as the 'default' within that 'object defaults' style that the active 'standard' style is using.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 7 of 11

kv5053545
Advocate
Advocate

 Hi @WCrihfield @Frederick_Law 

Do you know if it is possible through code to know if the style editor is in read-only or read/write mode?

0 Likes
Message 9 of 11

WCrihfield
Mentor
Mentor

Hi @kv5053545.  Here is another way to check that status.  This is similar to what you would see within the header of the Styles & Standards dialog when you open it.  As you can see, this status is set within your active Project file.  But as @Frederick_Law pointed out, a style will also be ReadOnly if it is currently located within a 'library', instead of a local copy located within the local document.

DesignProject.StylesLibraryAccess 

Dim sStylesAccess As String = ThisApplication.DesignProjectManager.ActiveDesignProject.StylesLibraryAccess.ToString
MsgBox("Styles Access = " & sStylesAccess, vbInformation, "iLogic")

If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 10 of 11

Frederick_Law
Mentor
Mentor

Styles are stored in Template, Library and File/Local (ipt, iam, idw, dwg).

Changing Styles in one will not change/update the other.

 

iLogic should be able to modify Local Style.

https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-565EF853-33D9-475E-8D93-0039315B9678

Might need to "ConvertToLocal":

https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-9A7ED9EE-D7E9-47AD-8B5C-3283C447407D

Message 11 of 11

Frederick_Law
Mentor
Mentor

I believe what you want to do is "Sync" style of drawing to match Library/Template.

 

Setup Styles the way you want in Template. Save the Template.

Set Style Library to Read/Write.

Save Template Style to Library.

Set Style Library to Read Only.

Open each Drawing, Update Style.