×
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

renaming Sketches with a Jurnal or a Macro

renaming Sketches with a Jurnal or a Macro

renaming Sketches with a Jurnal or a Macro

(OP)
Hello,
I'm new in this forum. I've got a little problem because I have to rename nearly 1000 sketches, and I do not know how to write a little program to help me do this work. Exactly I have to add a the same String to the name of many sketches, for example to the name of all selekted sketches. Is there anyone whow can post me a macro or a jurnal or something else to help me do this job???
best regards...

RE: renaming Sketches with a Jurnal or a Macro

Hi,

  I don't believe there is a macro to rename sketches & to create one, seems like it's more trouble then it's worth.

  Typically, as a best practice, the Designer should name sketches up front, such as, "SK_XSECT"

  SK = Sketch
  XSECT = Cross section


  May be a lot of rework, but you are probably better off manually renaming.  Also, having a 1000 sketches in model is a bit excessive, even if you really don't have that many.

  Hope that helps.

Jason M.
Unigraphics NX & SolidWorks Designer

RE: renaming Sketches with a Jurnal or a Macro

(OP)
HI Jason,

I don't have 1000 sketches in one part, but I got quit a lot of Parts with up to 200 sketches. I have to add the ISO-standard to the naming of the sketches. So this is really a lot of work if I do it manually. On the other hand it is a good chance to learn a little about automatization. I have another thing to do. I've got to replace a part of the naming-Sting for Example "Profile" to "Pr". To get enough free characters to ad the ISO-standard to the naming. I hope there will be a way to do so. I recorded a journal, but I do not know how to write a loop to rename all selected sketches...

' NX 6.0.2.8
' Journal created by Jochen on Wed Nov 04 08:07:41 2009 Westeuropäische Normalzeit
'
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

' ----------------------------------------------
'  Dialogfenster Anfang Skizze Eigenschaften
' ----------------------------------------------
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Properties")

Dim sketch1 As Sketch = CType(workPart.Sketches.FindObject("Flatbar-100X10"), Sketch)

sketch1.SetName("Flatbar-100X10-ISO123456")

Dim nErrs1 As Integer
nErrs1 = theSession.UpdateManager.DoUpdate(markId1)

' ----------------------------------------------
'  Menü: Werkzeuge->Journal->Stop Recording
' ----------------------------------------------

End Sub
End Module




kind regards
Jochen

 

RE: renaming Sketches with a Jurnal or a Macro

Hi Joshen874,

  The only other thing I could suggest is to use UG's Excel & attempt to write a macro within that.

  Perhaps, to test it out, you may want to export or copy your data into the regular version of Excel & test in that environment.

  Attempt to use as if you were setting up a part-family.  I'm assuming that you now have a bunch of generic sketch names, which would make a bit harder for Excel to "find & replace" because names aren't similar.

  Other then that, I'm not sure what else I would suggest by not seeing the data.  Actually, there is one more - Find an intern to assist, but that's probably not an option.

  Good Luck...

Jason M.
Unigraphics NX & SolidWorks Designer

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