How to retrieve drafting settings from a legacy drawing template?
How to retrieve drafting settings from a legacy drawing template?
(OP)
Hi,
Currently my Drawing Settings are "Use Settings from Drawing Template". I want to use "Use Settings from Standard" but then I need to harmonize the drafting standard with the drawing settings in the legacy drawing template.
I realize I could manually compare all the settings in the drafting standard with those in the drawing. This doesn't seem like a smart / efficient / fast approach. Does anyone have a better idea on now to retrieve drafting settings from a legacy drawing template?
This is my first post. I'm looking forward to your reply(s).
Currently my Drawing Settings are "Use Settings from Drawing Template". I want to use "Use Settings from Standard" but then I need to harmonize the drafting standard with the drawing settings in the legacy drawing template.
I realize I could manually compare all the settings in the drafting standard with those in the drawing. This doesn't seem like a smart / efficient / fast approach. Does anyone have a better idea on now to retrieve drafting settings from a legacy drawing template?
This is my first post. I'm looking forward to your reply(s).





RE: How to retrieve drafting settings from a legacy drawing template?
Why? What problems arise if you don't?
www.nxjournaling.com
RE: How to retrieve drafting settings from a legacy drawing template?
first i set customer defaults. ( i use settings from standard but all settings are not covered, some defaults will not be affected by this option.)
then i open template after template
open the preferences Annotation, load all defaults, OK the dialog.
If some other dialog / settings are affected by the change in customer defaults, such as a change to section lines, i need to open that preference dialog and make the change manually. - there are no "load" button.
If there are multiple changes like the section line thing, i will create a macro which changes the settings in the open partfile. ( we have some 20-25 drawing templates )
save and close.
Regards,
Tomas
RE: How to retrieve drafting settings from a legacy drawing template?
The problem is the other way around. I have only one template but I want to get the settings from the template into my drafting standard. Since posting this question I have made a list of all drafting standards with part scope and manually searched for the corresponding setting in the part. This took hours and I couldn't even find everything.
@cowski - If I make the drafting standard leading (which I want) it needs to have the correct settings.
@Toost - If I had 25 templates I would definitely want to make sure that the drafting standards are leading. Then you don't have to update your templates when there is a change in your customer defaults or drafting standards.
Best regards,
Remco
RE: How to retrieve drafting settings from a legacy drawing template?
www.nxjournaling.com
RE: How to retrieve drafting settings from a legacy drawing template?
Customer defaults overrides "some but not all" drafting settings in the template. ( i.e NX7.5 does that, can't speak for newer releases.)
I assume that this is something which will be fixed in time, it takes time and money to go through all settings and it isn't something that sells to new customers.
back to topic,
exporting the settings from an existing partfile is something that i don't think is ( easily) possible.
Maybe John or Cowski can help.
Cowski, - can one read "all drafting defaults" in a partfile and export to say textfile / .dpv ? ( in a reasonable amount of programming work)
Regards,
Tomas
RE: How to retrieve drafting settings from a legacy drawing template?
I've tested this and it is true. However, as far as I understand, it is only true for settings which have a "part" scope, not the "session" scope.
RE: How to retrieve drafting settings from a legacy drawing template?
www.nxjournaling.com
RE: How to retrieve drafting settings from a legacy drawing template?
Regards,
Tomas
RE: How to retrieve drafting settings from a legacy drawing template?
www.nxjournaling.com
RE: How to retrieve drafting settings from a legacy drawing template?
Does someone know if you can use SNAP to read setting values in a part? I wasn't planning to learn SNAP only to do this but if someone has an example of reading part settings then it would get me a big head start.
RE: How to retrieve drafting settings from a legacy drawing template?
CODE
Option Strict Off Imports System Imports NXOpen Imports NXOpen.UF Module Module1 Dim theSession As Session = Session.GetSession() Dim theUfSession As UFSession = UFSession.GetUFSession() Dim lw As ListingWindow = theSession.ListingWindow Sub Main() If IsNothing(theSession.Parts.Work) Then 'active part required Return End If Dim workPart As Part = theSession.Parts.Work lw.Open() 'get work part preferences Dim arrowLengthA As Double = workPart.Annotations.Preferences.GetLineAndArrowPreferences.ArrowheadLength Dim arrowAngleB As Double = workPart.Annotations.Preferences.GetLineAndArrowPreferences.ArrowheadIncludedAngle Dim dotDiameterC As Double = workPart.Annotations.Preferences.GetLineAndArrowPreferences.DotArrowheadDiameter Dim stubSizeD As Double = workPart.Annotations.Preferences.GetLineAndArrowPreferences.StubLength Dim extensionLengthE As Double = workPart.Annotations.Preferences.GetLineAndArrowPreferences.LinePastArrowDistance Dim extensionAngleF As Double = workPart.Annotations.Preferences.GetLineAndArrowPreferences.ObliqueExtensionLineAngle Dim dimTextToLineG As Double = workPart.Annotations.Preferences.GetLineAndArrowPreferences.TextToLineDistance Dim extLine1GapH As Double = workPart.Annotations.Preferences.GetLineAndArrowPreferences.FirstPosToExtLineDist Dim extLine2GapJ As Double = workPart.Annotations.Preferences.GetLineAndArrowPreferences.SecondPosToExtLineDist Dim datumArrowExtensionK As Double = workPart.Annotations.Preferences.GetLineAndArrowPreferences.DatumLengthPastArrow Dim textOverStubGapL As Double = workPart.Annotations.Preferences.GetLineAndArrowPreferences.TextOverStubSpaceFactor Dim textOverLeaderGapM As Double = workPart.Annotations.Preferences.GetLineAndArrowPreferences.TextOverLeaderGapFactor Dim allAroundSymbolIdN As Double = workPart.Annotations.Preferences.GetLineAndArrowPreferences.AllAroundSymbol 'get customer default preferences Dim cdArrowLengthA As Double Dim cdArrowAngleB As Double Dim cdDotDiameterC As Double Dim cdStubSizeD As Double Dim cdExtensionLengthE As Double Dim cdExtensionAngleF As Double Dim cdDimTextToLineG As Double Dim cdExtLine1GapH As Double Dim cdExtLine2GapJ As Double Dim cdDatumArrowExtensionK As Double Dim cdTextOverStubGapL As Double Dim cdTextOverLeaderGapM As Double Dim cdAllAroundSymbolIdN As Double If workPart.PartUnits = BasePart.Units.Millimeters Then 'metric part units cdArrowLengthA = theSession.OptionsManager.GetRealValue("Drafting_arrowSize_MU") cdDotDiameterC = theSession.OptionsManager.GetRealValue("Drafting_dotDiameter_MU") cdStubSizeD = theSession.OptionsManager.GetRealValue("Drafting_stubbSize_MU") cdExtensionLengthE = theSession.OptionsManager.GetRealValue("Drafting_lineArrow_MU") cdDimTextToLineG = theSession.OptionsManager.GetRealValue("Drafting_textLine_MU") cdExtLine1GapH = theSession.OptionsManager.GetRealValue("Drafting_pointLine1_MU") cdExtLine2GapJ = theSession.OptionsManager.GetRealValue("Drafting_pointLine2_MU") cdDatumArrowExtensionK = theSession.OptionsManager.GetRealValue("Drafting_datumExtLine_MU") cdAllAroundSymbolIdN = theSession.OptionsManager.GetRealValue("Drafting_allAroundSymbolSize_MU") Else 'english part units cdArrowLengthA = theSession.OptionsManager.GetRealValue("Drafting_arrowSize_EU") cdDotDiameterC = theSession.OptionsManager.GetRealValue("Drafting_dotDiameter_EU") cdStubSizeD = theSession.OptionsManager.GetRealValue("Drafting_stubbSize_EU") cdExtensionLengthE = theSession.OptionsManager.GetRealValue("Drafting_lineArrow_EU") cdDimTextToLineG = theSession.OptionsManager.GetRealValue("Drafting_textLine_EU") cdExtLine1GapH = theSession.OptionsManager.GetRealValue("Drafting_pointLine1_EU") cdExtLine2GapJ = theSession.OptionsManager.GetRealValue("Drafting_pointLine2_EU") cdDatumArrowExtensionK = theSession.OptionsManager.GetRealValue("Drafting_datumExtLine_EU") cdAllAroundSymbolIdN = theSession.OptionsManager.GetRealValue("Drafting_allAroundSymbolSize_EU") End If cdArrowAngleB = theSession.OptionsManager.GetRealValue("Drafting_includedAngle") cdExtensionAngleF = theSession.OptionsManager.GetRealValue("Drafting_extensionLineAngle") cdTextOverStubGapL = theSession.OptionsManager.GetRealValue("Drafting_textOverStubFactor") cdTextOverLeaderGapM = theSession.OptionsManager.GetRealValue("Drafting_textOverLeaderGapFactor") lw.WriteLine("Compare value of Customer Default (CD) setting to Part File (PF)") lw.WriteLine("") PrintResult("Arrowhead length (A)", cdArrowLengthA, arrowLengthA) PrintResult("Arrowhead included angle (B)", cdArrowAngleB, arrowAngleB) PrintResult("Dot diameter size (C)", cdDotDiameterC, dotDiameterC) PrintResult("Stub Length (D)", cdStubSizeD, stubSizeD) PrintResult("Line past arrow (E)", cdExtensionLengthE, extensionLengthE) PrintResult("Extension line angle (F)", cdExtensionAngleF, extensionAngleF) PrintResult("Gap text to line (G)", cdDimTextToLineG, dimTextToLineG) PrintResult("Extension line 1 gap (H)", cdExtLine1GapH, extLine1GapH) PrintResult("Extension line 2 gap (J)", cdExtLine2GapJ, extLine2GapJ) PrintResult("Datum extension (K)", cdDatumArrowExtensionK, datumArrowExtensionK) PrintResult("Text over stub factor (L)", cdTextOverStubGapL, textOverStubGapL) PrintResult("Text over leader factor (M)", cdTextOverLeaderGapM, textOverLeaderGapM) PrintResult("All around symbol size ID (N)", cdAllAroundSymbolIdN, allAroundSymbolIdN) lw.Close() End Sub Sub PrintResult(ByVal title As String, ByVal CdValue As Double, ByVal PfValue As Double) lw.WriteLine(title) If PfValue.Equals(CdValue) Then lw.WriteLine(" $$ Huzzah! they match $$") Else lw.WriteLine(" ## Oh no! they don't match ##") End If lw.WriteLine("CD value: " & CdValue.ToString) lw.WriteLine("PF value: " & PfValue.ToString) lw.WriteLine("") End Sub End Modulewww.nxjournaling.com
RE: How to retrieve drafting settings from a legacy drawing template?
This looks like its exactly what I need. I haven't used journalling before but the syntax looks familiar enough. I'm confident that I can add any other preferences that I need.
All the best,
Remco
RE: How to retrieve drafting settings from a legacy drawing template?
www.nxjournaling.com