Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

View Label Defaults, flat pattern

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
josh
1064 Views, 9 Replies

View Label Defaults, flat pattern

Hi,

 

While trying to customize my view defaults I realized that there does not seem to be an option for changing the default flat pattern labels, or if there is it is not in the same place: StyleLibrary>Standard>View Preferences>View Type.

 

Can anyone tell me where this option is?

 

Thanks!

9 REPLIES 9
Message 2 of 10
mcgyvr
in reply to: josh

Flat pattern views just use the standard "Base/Projected,etc..." view labels..

Maybe I didn't understand the question.. Can you show an image of what specifically you are trying to change that isn't part of those standard view types? Maybe you were talking about bend note annotations which are modified on the "Notes and Leaders" tab of the applicable Dimension standard with the "Bend Note Settings" icon selected?



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 3 of 10
josh
in reply to: mcgyvr

Not needed, I understand now that flat pattern is merely an option of the base view. In the true base view of my parts I have the part number and scale set to display by default. This view provides finished dimensions for the shop among other basic information.

 

Typically on the same page I will also place the flat pattern on which I want the display to have Custom properties: Material, gauge, flat extents(usually not included, easier to do with dimensions right now). I have been manually changing the text display and I was hoping the eliminate the repetitive steps. If it can be done with ilogic I am not versed enough to know how to write that code.

Message 4 of 10
mcgyvr
in reply to: josh


@josh wrote:

Not needed, I understand now that flat pattern is merely an option of the base view. In the true base view of my parts I have the part number and scale set to display by default. This view provides finished dimensions for the shop among other basic information.

 

Typically on the same page I will also place the flat pattern on which I want the display to have Custom properties: Material, gauge, flat extents(usually not included, easier to do with dimensions right now). I have been manually changing the text display and I was hoping the eliminate the repetitive steps. If it can be done with ilogic I am not versed enough to know how to write that code.


@josh 

Josh,

This code will find any flat pattern views and edit the view label and  assumes you have custom iprops named Material, Gauge, Flat Extents.. Try it... I think you can modify to suit the actual names of your custom iprops.. If not.. Let me know if you need help and provide specifics..

 

Its Friday and time for beer... Be back Monday..

 

doc = ThisDoc.Document
For Each oSheet In doc.Sheets
  For Each oView In oSheet.DrawingViews
    If oView.IsFlatPatternView  Then
        'capture the current view label
                ViewLabel = oView.Name
                oModelName = _
                oView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
                Try
            oMaterial = iProperties.Value(oModelName, "Custom", "Material")  
			oGauge = iProperties.Value(oModelName, "Custom", "Gauge")
			oExtents = iProperties.Value(oModelName, "Custom", "Flat Extents")
            'add the the iProperty to the current view label, with a dash separator
                oView.Name = ViewLabel & " - " & oMaterial & " - " & oGauge & " - " & oExtents
            Catch
            'do nothing if error
                End Try
    End If
  Next
Next

 

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 5 of 10
josh
in reply to: mcgyvr

@mcgyvr  

Thanks for banging that code out, I have examined it and I see that it edits the View label. When the parameter has the correct name it adds the parameter to the view label. 

 

Can it be made to edit the "Format Text" (access by dbl clicking on the view text) window and delete old text from the View Label and Format Text window? If I use it as is I still have to edit the View Label and the Format Text window to get the proper appearance.

 

Thanks in advance!

-j

Message 6 of 10
mcgyvr
in reply to: josh

@josh Like this? The code before was appending these 3 iproperties to the existing view label.. This replaces it with the 3 iprops only.. If this isn't what you wanted please specify exactly what you want the view label to say and please provide the custom iproperty field names too if they aren't as I have written them below.

 

doc = ThisDoc.Document
For Each oSheet In doc.Sheets
  For Each oView In oSheet.DrawingViews
    If oView.IsFlatPatternView  Then
                oModelName = _
                oView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
                Try
            oMaterial = iProperties.Value(oModelName, "Custom", "Material")  
			oGauge = iProperties.Value(oModelName, "Custom", "Gauge")
			oExtents = iProperties.Value(oModelName, "Custom", "Flat Extents")
            'add the the iProperty to the current view label, with a dash separator
                oView.Name = oMaterial & " - " & oGauge & " - " & oExtents
            Catch
            'do nothing if error
                End Try
    End If
  Next
Next

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 7 of 10
josh
in reply to: mcgyvr

@mcgyvr 

 

Thank you for the quick reply! I see that you removed the line "ViewLabel = oView.Name" and that when we write into oView by default it overrides what is there. The line removed captures the current state of the view name. 

 

The screen shot below shows the format text window, is there any way that we can modify that window to remove <PARTNUMBER> and SCALE <SCALE>? This is the last extra step before this feature is fully automated.

 

Note that on the view label shown specifically the line " - ?? - 65.110...." it just a formatting thing on my end and shows that your code is working on the view label.

 

thanks

-j

 

Inventor help.jpg

Message 8 of 10
mcgyvr
in reply to: josh

@josh  Sorry.. I spaced out a bit.. Try this..

doc = ThisDoc.Document
For Each oSheet In doc.Sheets
  For Each oView In oSheet.DrawingViews
    If oView.IsFlatPatternView Then
		
        'capture the current view label
                ViewLabel = oView.Name
			'clear current view label	
				oView.Label.FormattedText = ""
				
                oModelName = _
                oView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
                Try
            oMaterial = iProperties.Value(oModelName, "Custom", "Material")  
			oGauge = iProperties.Value(oModelName, "Custom", "Gauge")
			oExtents = iProperties.Value(oModelName, "Custom", "Flat Extents")
            'add the the iProperty to the current view label, with a dash separator
                oView.Label.FormattedText = ViewLabel & " - " & oMaterial & " - " & oGauge & " - " & oExtents
            Catch
            'do nothing if error
                End Try
    End If
  Next
Next


-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 9 of 10
josh
in reply to: mcgyvr

@mcgyvr 

 

First I want to say thanks for your help! The updated code indeed clears the formatted text label, which also removes <VIEW> and thus displays nothing.

 

I found this and this which showed me how I can add the property material allowing me to remove the custom property.

 

I am unable to figure out how to add the view label property <VIEW> which I suppose is not needed now that I can add it all directly, skipping populating <VIEW> with the desired information. But if I wanted to add <VIEW> back in how would I do that?

-j

 

doc = ThisDoc.Document
For Each oSheet In doc.Sheets
  For Each oView In oSheet.DrawingViews
    If oView.IsFlatPatternView Then
                ViewLabel = oView.Name
			'clear current view label	
				oView.Label.FormattedText = ""
				
                oModelName = _
                oView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
                Try
            oMaterial = "<StyleOverride Underline='False'><Property Document='model' PropertySet='Design Tracking Properties' Property='Material' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property></StyleOverride>"
			oGauge = iProperties.Value(oModelName, "Custom", "ShtThk")
			oExtents = iProperties.Value(oModelName, "Custom", "FlatLength")
            'add the the iProperty to the current view label, with a dash separator
                oView.Label.FormattedText = oMaterial & " - " & oGauge & " - " & oExtents 
            Catch
            'do nothing if error
                End Try
    End If
  Next
Next

 

Message 10 of 10
mcgyvr
in reply to: josh

@josh  You said material was custom so I didn't give you the standard one.. Good on you for figuring that one out on your own.. 

To get the view name back into the new label you constructed just do this..

You just need to change this..

 

 

oView.Label.FormattedText = oMaterial & " - " & oGauge & " - " & oExtents 

 

 

To this..

 

 

oView.Label.FormattedText = ViewLabel & " - " & oMaterial & " - " & oGauge & " - " & oExtents 

 

 

 

The code stored the original view name in the ViewLabel variable to be used where you want later.. 

 

I'm out for the weekend.. Beer in hand... 

 

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269

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

Post to forums  

Autodesk Design & Make Report