Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to retrieve drafting settings from a legacy drawing template?

Status
Not open for further replies.

RemcoDijkstra

Mechanical
Oct 3, 2014
5
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).
 
Replies continue below

Recommended for you

The way i update our templates is ,

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
 
Hi guys, thanks for the replies.

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
 
I've not switched from the "template settings" to the "standard settings" or vice-versa, but I always assumed it would pick up the settings from the location you specified. Does this not happen? When you switch to "standard", it still uses the settings from the template?

www.nxjournaling.com
 
Cowski,
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


 
The settings "Use Settings from Drawing Template" and "Use Settings from Standard" determine where your drafting settings come from. So if you use "Use Settings from Drawing Template" then NX will ignore the drafting standard. And if you use "Use Settings from Standard" then NX will follow the drafting standard and ignore the values of the settings in the 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.
 
If you have a part open and want to use the settings as defined in the customer defaults, won't "load all defaults" in the annotation preferences dialog do the job?

www.nxjournaling.com
 
Cowski, he want to do the opposite, -feed into the customer defaults the settings he has done in an old partfile.

Regards,
Tomas
 
Hi guys, thanks for revisiting this post.

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.
 
I'm not familiar with SNAP, so I can't comment on how to accomplish such a task with SNAP or even if it is possible. But, below is some example journal code that will compare the annotation line/arrow settings (values A - N) from the customer defaults vs. the part file setting. Hopefully this will help get you started.

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 Module

www.nxjournaling.com
 
Cowski, you're awesome!

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
 
I wish you the best of luck. The little journal I posted took me a few hours to research and put together (and I cherry picked some easy values to compare!). The code itself is the easy part; finding the correct customer default name and matching it to the part file values takes some time.

www.nxjournaling.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor