Change module through VB
Change module through VB
(OP)
Can anyone tell me if there are any commands available in VB that allow you to change from the drafting module to the modeling module, assuming that modeling has not yet been started. I tried recording a few journals but it doesn't seem to record these events.
Bruce
Bruce





RE: Change module through VB
Right Click->Customize->Commands
Under "Application", bring the Drafting button to your toolbar.
Then again, if your goal is to begin the drafting application right away, you can select a drawing when specifying your new part.
RE: Change module through VB
RE: Change module through VB
RE: Change module through VB
If you are working in external mode you can use any of the modeling/drafting related routines.
If you are working in internel mode i am not finding any routine which switches the application. But, you can find the existing application with the below mentioned routine and then compare it with the required application.
Public Sub AskApplicationModule ( _
<OutAttribute> ByRef module_id As Integer _
)
RE: Change module through VB
It is an application used to open models and take screenshots of them. If a i try to take a screenshot or change the view type(wireframe,shaded,etc...) then the program fails. If the models are switched to the modeling view however, then the program executes just fine.
RE: Change module through VB
MainSession.Parts.Display.Views.WorkView.RenderingStyle = View.RenderingStyleType.ShadedWithEdges;
I get an Object not found error. The same error occurs if it try to execute on the workpart as well:
MainSession.Parts.Work.Views.WorkView.RenderingStyle = View.RenderingStyleType.ShadedWithEdges;
Is there another way to call these methods that won't throw an error if I am currently on a draftin sheet?
RE: Change module through VB
See http:/
RE: Change module through VB
I'm starting to think this might just be the way it is.
RE: Change module through VB
RE: Change module through VB
I am using an externally compiled C# application, and running it by using the Execute NXOpen command. I am not very familiar with the execution of journals within NX(though I have experience in CATIA), so if anyone can test this for me on this avenue, it would be greatly appreciated.
I also discovered that AskApplicationModule does not function properly when executed from an outside program. It always returns '80' regardless of module. (Though that is documented in the .NET help).