×
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

Work Layer Changing

Work Layer Changing

Work Layer Changing

(OP)
Hello all,

I have looked through the forum but cant see any threads with my issue.

I am working on NX4. My Company always have their custom border inserted on a sheet inside the model file so the model and drafting are all one file.

I have wrote a macro to add the border and standard text.
I have run into some probelms with the border in relation to
layers:

...My Border and text in my macro is on layers 100 and 102 respectively.
...I always change my work layer to layer 100 before I insert my macro.
...When I insert my macro into a blank drawing ie- No sketches, No blocks, No additional datum planes my work layer does not change.
...When I insert my macro into a drawing with a part the work layer changes to layer 60.
...Layer 60 is the layer were I insert new datum planes.

Here comes the BIG probelm:

When I insert a large or really complicated part or assembly my border and text changes to a random layer.
Although it doesnt seem like a big deal as you can change back to the original layers theres no reason why it shouldnt work and its alot of hassle and wasted time when your drafting alot.

Thanks for any advice in advance,

Andrew Owens
Development Engineer

RE: Work Layer Changing

Is the border in its own file and then the macro imports that file into your working file? Are different sized borders each in their own file or are they combined into 1 file? I ask because when you import a file you have the option to import the entities onto the work layer or the original layer (the layer the entities are on in the file you are importing from).

Does the macro change the work layer to the desired layer before importing and/or adding entiites? (if not, it should)

Is the macro starting from a known state? Strange things may happen if the macro is not started in the same application it was recorded in - for instance if you record a macro in the modeling application you may get some unexpected results if you later try to run the macro in the drafting application. You may have to do a 'gateway reset' as the first action in the macro to make sure it starts in the correct context. When you record the macro switch to the gateway application as the first action, then switch to the desired application and run your commands. The gateway reset will make sure the macro is run in the intended way.

RE: Work Layer Changing

Andrew,

Honestly what you describe as your BIG problem sounds like you may have found something that you need to refer to PLMS for a second look, (dare I say bug). Seriously if there really is random behavior then in computer terms it can't be good. You may be helping others by referring it, and for yourself well there may be a patch already out there if it is a known problem. Without your files and macros I doubt that anyone else could duplicate the problem. So if I were you I'd go back to a file where it happened using the macro and attempt to re-create the same results by stepping through the same procedure without using your macro to see if that is where the problem lies.

Because you're working in a drawing I wonder if it isn't something to do with "Visible in View". So if you add a could of steps in your macro that set the Visible in View layers to global for the drawing sheet it may help.

You may also want to compare how a journal file works as opposed to a macro. You may have more luck.

All things being equal I might solve the problem by approaching the task differently. I understand what you're trying to do and that you may have some reason that I hope you'll share if you disagree with me. On the other hand there was a time when we used to work with drawing borders in this way, but now we use master model concept and drafting templates and we've never looked back. We have written extensive descriptions of how it is done in this forum alone. If you think that this approach may suit you then I can highly recommend it to you.

http://www.eng-tips.com/viewthread.cfm?qid=206051&page=1

Last but not least please write back and let us know how you get on I'm keen to know the result of our attempts to help.

Regards

Hudson

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