×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to retrieve drafting settings from a legacy drawing template?

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).

RE: How to retrieve drafting settings from a legacy drawing template?

Quote (RemcoDijkstra)

...but then I need to harmonize the drafting standard with the drawing settings in the 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?

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

RE: How to retrieve drafting settings from a legacy drawing template?

(OP)
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

RE: How to retrieve drafting settings from a legacy drawing template?

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

RE: How to retrieve drafting settings from a legacy drawing template?

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


RE: How to retrieve drafting settings from a legacy drawing template?

(OP)
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.

RE: How to retrieve drafting settings from a legacy drawing template?

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

RE: How to retrieve drafting settings from a legacy drawing template?

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

Regards,
Tomas

RE: How to retrieve drafting settings from a legacy drawing template?

Thanks Toost, not the first time I've been turned around! upsidedown

www.nxjournaling.com

RE: How to retrieve drafting settings from a legacy drawing template?

(OP)
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.

RE: How to retrieve drafting settings from a legacy drawing template?

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

RE: How to retrieve drafting settings from a legacy drawing template?

(OP)
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

RE: How to retrieve drafting settings from a legacy drawing template?

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources