×
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

macro for sending objects to layers
2

macro for sending objects to layers

macro for sending objects to layers

(OP)
Hi all,

How can I create a macro, to send model objets, solids, splines, points, datums etc. To selected layers with a macro or .dll.

For example,

Solids to layer_1, Points to layer_2, Splines to layer_3 etc.

I want a  customized macro o a .DLL file. But I am not a programmer.

Some help.

Thanks.

RE: macro for sending objects to layers

A macro follows whatever keystrokes you used when creating it, so as far as sending model objets, solids, splines, points, datums etc to specific layers use you masks to turn make only the type of object selectable that you want put into a specific layer.

 For example if you want to move splines into a specific layer:
Format > Move to Layer > type > toggle only curves "On" > detail filtering (at bottom of window) > spline > ok > ok > "select all" > ok > pick the layer that those splines will go into

You don't need to be any sort of programmer to do a macro, but it may take a little practice . . . just remember that it will follow whatever keystrokes you do after you select "start macro" unp until "stop record"

RE: macro for sending objects to layers

Actually this is the sort of thing which GRIP does a pretty good job with.  Do you have a GRIP execute license?  If so, please provide a complete list of what you want on which layer.

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.com/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: macro for sending objects to layers

(OP)
Hi John,

Yes I have open license on GRIP, .NET, API etc.
But I am quiet new user on NX programming.
I don't know yet, how to execute a GRIP program on NX. Usually I execute .VB macros and some . dll files.
Just simple program to change color to pieces, etc.
Just with some example I can try to customize it.

I am using NX 7.5.3

Thanks.

RE: macro for sending objects to layers

Attached is a simple GRIP program which will move a list of object types, each to a user designated layer.  To execute the program, just go to...

File -> Execute -> GRIP...

...and select the GRIP executable (.grx) file.

Try it out and see if this was what you were looking for.

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.com/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: macro for sending objects to layers

(OP)
Hi John,

Your are right, I was looking for this.

I am going to pass this GRIP to VB.

I thik is more open .VB programing for loading on NX, with jounaling.

Thanks.

RE: macro for sending objects to layers

(OP)
Hi John,

How can I pass this GRIP program to C++ or VB code?

Thanks.

RE: macro for sending objects to layers

You can spawn a program from GRIP and there are ways to pass data between them, but I would need more information as to what it is that you're looking to pass between programs.

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.com/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: macro for sending objects to layers

2
Attached is a similar VB journal which moves the same types to similar layers as John's GRIP program.  I have saved it as a .txt file in the zip.  Just change the extension back to .vb.

Just for education purposes I have used three different methods for the object types.  This should make it possible to extend it for any other types of displayable objects.

Frank Swinkels

RE: macro for sending objects to layers

(OP)
Hi Frank,

This was I am looking for, one questions how can I customize this .VB, as John's GRIP that it takes a small window, for changing defined layers on the .VB.

I don't know with .VB how to take this small interface windows.

Thanks.

RE: macro for sending objects to layers

Attached is the modified journal which uses a BlockStyler dialog.  Please note the following:

This dialog is only suitable for NX7.5.  The dialog code means that to use it on say NX6 would throw an error.

Make sure the dlx file is in one of the following locations:
 1.) From where NX session is launched
 2.) $UGII_USER_DIR/application
 3.) For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly recommended. This variable is set to a full directory path to a file containing a list of root directories for all custom applications. e.g., UGII_CUSTOM_DIRECTORY_FILE=$UGII_ROOT_DIR\menus\custom_dirs.dat

Frank Swinkels

RE: macro for sending objects to layers

Frankswinks

I am confused on your UGii_use_dir/application suggestion where to put the DLX file. Could you please explain a little bit better on how to set this up?

Will this work running NX out of teamcenter?

We very new to NX and this will work great for us.  Thanks.

RE: macro for sending objects to layers

Here is one method to have access to the dialogs. My example is what I use.  You can change the directories as needed.

1) Assume we have a directory structure.

C:\uguser\application
C:\uguser\startup
C:\uguser\udo

The application subdir contains all my dlx files (for Block Styler)

The startup subdir contains any tbr files (for toolbars) and any dll files which are loaded at startup (ie in the tbr files).

The udo subdir contains any udo dll files.

2)We now need to place an entry in an appropriate custom_dirs.dat file.

My custom_dirs.dat file (for NX6) is at:

C:\ugs\nx6\UGII\menus\

Edit the custom_dirs.dat file by adding a line which in my case is

C:/uguser/

Note do not use C:/uguser/application.  NX would look for C:/uguser/application/application which of course does not exist.

3) Finally create an environment variable.

The variable name is UGII_CUSTOM_DIRECTORY_FILE

The variable value is C:\ugs\nx6\UGII\menus\custom_dirs.dat (based on the above example values)

Hope this helps.

Frank Swinkels
 

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