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!
Solved! Go to Solution.
Solved by mcgyvr. Go to Solution.
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?
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 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,
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
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
@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
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
@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
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
@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...
Can't find what you're looking for? Ask the community or share your knowledge.