Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations pierreick on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programati?cally select drawing items by layer and move them.

Status
Not open for further replies.

Duder58

Petroleum
Feb 6, 2014
14
Is it possible to programatically select all items on a certain drawing layer (256 for example) and move them to a different location on a drawing? If so, could you please provide a code snippet showing that?



I am using NX 8.5 and VB.Net



Thanks
 
Replies continue below

Recommended for you

No need for a program, although I'm sure it could be done if it's a must. Not my area of expertise.

Without a program and using your example, make sure layer 256 is visible and selectable. Format -> Move to Layer. On the Class Select dialog box that appears, make sure you have all options expanded and in the lower third of the dialog you'll see your filter options - pick the Layer filter, select layer 256, then OK (this sets up the selection to only pick objects on layer 256), then up at the top of the Class Selection dialog, pick Select All. This will bring up another dialog from which you pick the destination layer - make your pick and OK/Apply. Done.

You also can preselect objects then invoke the commands, if you prefer that route. The NX Help docs should assist in helping you understand that a little better. Note that you can filter by object types, colors, layers, attributes and select/deselect all from the Class Selection or Preselection filters.

Tim Flater
NX Designer
NX 9.0.3.4 Win7 Pro x64 SP1
Intel Xeon 2.53 GHz 6GB RAM
NVIDIA Quadro 4000 2GB
 
Tim, thanks for your response but I probably didn't explain what I am attempting to do very well. I want to be able to select all items on layer 256 which in my case is a title block and some symbols and to move them to a different location on the drawing.

Regards,
Scott
 
Scott,

You explained it just fine and what I posted above will achieve exactly what you wish to do - the layer filters disallow any selection of objects which reside on any other layers except the ones you select to apply as the filter.

Watch the movie I've attached (zipped) - mixed geometry types, all reside on layer 1 except for the 6 points which are on layer 256. I invoke the Move To Layer command, set my layer filter to 256 and move the points to layer 10. Pretty much what you're asking, correct? I'm using NX9 but the Move To Layer command has been around for ages, won't be any different for you.

[link ]layer_move.zip[/url]

Tim Flater
NX Designer
NX 9.0.3.4 Win7 Pro x64 SP1
Intel Xeon 2.53 GHz 6GB RAM
NVIDIA Quadro 4000 2GB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor