Need .vb to copy attributes from master part to 2D drawing template
Need .vb to copy attributes from master part to 2D drawing template
(OP)
Hi,
I´ve been looking in the forum and there is some info but what i would like is toask if some one have a vb file that would copy attributes from master part to 2D drawing template so I didn´t have to copy paste attribute every time.
thanks
I´ve been looking in the forum and there is some info but what i would like is toask if some one have a vb file that would copy attributes from master part to 2D drawing template so I didn´t have to copy paste attribute every time.
thanks





RE: Need .vb to copy attributes from master part to 2D drawing template
------------------------------------------------------------
' NX 4.0.0.25
' Journal created by Henry on Tue Mar 21 10:57:55 2006 FLE Standard Time
'
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
' ----------------------------------------------
' Menu: File->Properties
' ----------------------------------------------
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Properties")
Dim TimeNote As DateTime
TimeNote = System.DateTime.Now()
Dim TimeNoteString as String() = TimeNote.GetDateTimeFormats()
workPart.SetAttribute("DATE", TimeNoteString(1))
theSession.Parts.Work.SetAttribute("FILENAME",theSession.Parts.Work.Leaf)
' ----------------------------------------------
' Menu: Tools->Journal->Stop
' ----------------------------------------------
End Sub
End Module
RE: Need .vb to copy attributes from master part to 2D drawing template
But what id like to do is to get master 3D part attributes such as material, ref, mw_stock_size and copy those attributes to the 2d drawing template based file.
all this with a vb file .
I appreciate the help.
RE: Need .vb to copy attributes from master part to 2D drawing template
I actually furnish my template files with the correct attributes and paste over them with values from other files that are similar.
Because all you're doing depends on attributes I'm pretty sure that you could do a lot of what you need using GRIP if necessary.
Cheers
Hudson