Drawing Templates
Drawing Templates
(OP)
To all with great advice for a newbie in UG NX7.0,
I have a part file of an aircraft wing which I have created and I would like to do several things fter all the 3d modeling in done:
1) Create a drawing sheet with a specified template of borders and text. Automate this process such that I could click a button in NX to pull up my drawing templates.
2) On the drawing sheet, I know how to get sections to be displayed of the wing. However, I would like to create section cuts along the wing and show it on my drawing sheet and automate this process such that I can do the same for a different wing part file. Would this mean that I would have to pogram in NX Open, GRIP or create Macros/journals to do this?
Your kind advice would be appreciated.
I have a part file of an aircraft wing which I have created and I would like to do several things fter all the 3d modeling in done:
1) Create a drawing sheet with a specified template of borders and text. Automate this process such that I could click a button in NX to pull up my drawing templates.
2) On the drawing sheet, I know how to get sections to be displayed of the wing. However, I would like to create section cuts along the wing and show it on my drawing sheet and automate this process such that I can do the same for a different wing part file. Would this mean that I would have to pogram in NX Open, GRIP or create Macros/journals to do this?
Your kind advice would be appreciated.





RE: Drawing Templates
As for Number 2, you could created one of those Drawing templates with a dummy part with several section views already defined. When you use this for a new part, you have to manually edit each section symbol so that it's at the proper location along the lenght of the wing, but at least you would not have to start from scratch each time.
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Drawing Templates
I am just curious whether you would manually edit each section name cut if for example I was to use the drawing template on a wing part of larger length. In that case, is it possible to use the drawing template for the dummy part by importing it into which ever part that I am currently working on?
KUAERO
RE: Drawing Templates
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Drawing Templates
KUAERO
RE: Drawing Templates
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Drawing Templates
NX 7.0.1.7, TC 8.1
RE: Drawing Templates
cmacca: Are you suggesting one template with borders created for different size sheets but placed on separate layers so that when I work with a specific sized sheet I could just turn on the layers containing the borders and text set for that sheet size?
RE: Drawing Templates
Copy this code to notepad and save as A3.vb. Then run it in NX via Tools->Journal->Play.
You can modify the code and do a save as for other sheet sizes.
To test it just draw three lines each on the above layers and set the sheet size to something that is not A3.
To learn NX open go to Help->Documentation->Automation->NX Open->Open for .NET.
We use VB but you can use other languages.
The Tool->Journal->record is also a good place to start creating your own code.
Also the GTAC website has good examples of code, you need a webkey account.
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.UI
Imports NXOpen.Utilities
Module NXJournal
Sub Main()
Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
' ----------------------------------------------
' Check if in Drafting
' ----------------------------------------------
Dim module_id As Integer = 0
ufs.UF.AskApplicationModule(module_id)
'Make sure you are in the drafting application
If module_id = UFConstants.UF_APP_DRAFTING Then
'Set undo point and name it "A3"
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "A3")
' ----------------------------------------------
' Menu: Format->Layer Settings...
' ----------------------------------------------
'Set work layer to layer 1
Dim stateArray3(0) As Layer.StateInfo
stateArray3(0).Layer = 1
stateArray3(0).State = Layer.State.WorkLayer
workPart.Layers.ChangeStates(stateArray3, False)
'Make sure layers 254, 255 and 256 are visible
Dim stateArray2(2) As Layer.StateInfo
stateArray2(0).Layer = 254
stateArray2(0).State = Layer.State.Visible
stateArray2(1).Layer = 255
stateArray2(1).State = Layer.State.Visible
stateArray2(2).Layer = 256
stateArray2(2).State = Layer.State.Visible
workPart.Layers.ChangeStates(stateArray2, False)
' ----------------------------------------------
' Menu: Format->Visible in View...
' ----------------------------------------------
' ----------------------------------------------
' Dialog Begin Visible Layers in View
' ----------------------------------------------
'Only show the layer border A3 is on
Dim stateArray1(255) As Layer.StateInfo
'Get existing layer settings
workPart.Layers.GetVisibilitiesInView(workPart.Views.WorkView, stateArray1)
'Change layer settings
stateArray1(253).Layer = 254
stateArray1(253).State = Layer.State.Hidden
stateArray1(254).Layer = 255
stateArray1(254).State = Layer.State.Hidden
stateArray1(255).Layer = 256
stateArray1(255).State = Layer.State.Visible
workPart.Layers.SetObjectsVisibilityOnLayer(workPart.Views.WorkView, stateArray1, True)
' ----------------------------------------------
' Menu: Edit->Sheet...
' ----------------------------------------------
'Set the new sheet size
Dim shtName As String = workPart.DrawingSheets().CurrentDrawingSheet.Name()
Dim drawingSheet1 As Drawings.DrawingSheet = CType(workPart.DrawingSheets.FindObject(shtName), Drawings.DrawingSheet)
Dim drawingSheetBuilder1 As Drawings.DrawingSheetBuilder
drawingSheetBuilder1 = workPart.DrawingSheets.DrawingSheetBuilder(drawingSheet1)
drawingSheetBuilder1.Option = Drawings.DrawingSheetBuilder.SheetOption.StandardSize
drawingSheetBuilder1.Height = 297.0
drawingSheetBuilder1.Length = 420.0
Dim nXObject1 As NXObject
nXObject1 = drawingSheetBuilder1.Commit()
drawingSheetBuilder1.Destroy()
End If
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
Return Session.LibraryUnloadOption.Immediately
End Function
End Module
NX 7.0.1.7, TC 8.1