There is the UFSession.Modl.ImportExp() function that does the same as the import from file option in the Expressions windows in NX.
You can start by exporting the expression files and edit as you like then load with one line of code in the journal. Then you don't have to read lines or cell it...
You need to attach ugraf.exe first and then launch NX from VS.
In VS open up Properties for your project. Go to the Debug tab and set Start External Program to your installed ugraf.exe.
Then when go Start from VS, it will launch (an attached) NX. If you put in a breakpoint it will then drop...
Hi Lars,
You don't describe you actual problem in enough detail to advise on what may be the problem.
I have no experience with the exportFlatPatternBuilder1 but you can also get a dxf by exporting the drawing sheet. The following is some working C# code that does that using the NXOpen...
Hi,
We use a slightly different approach (see code below) to create a JPEG that uses the canned views to rotate (Orient()) to and a different jpeg call (BatchShadeOptions()).
Couldn't tell you what the exact differences are but we don't get your problem.
Also you may be able to get your...
Have a look at the excellent NX Journaling site.
There is this tutorial on the very topic: Creating a Subroutine to Process all Components in an Assembly
Link
Paul
Paul Turner
CAD & Process Engineer
Mastip Technology
I don't believe that you can rename an attribute.
Instead delete it and create a new one.
Everything references the attribute by it's name so this is appropriate.
Paul
Paul Turner
CAD & Process Engineer
Mastip Technology
Nelson,
Here's the basic steps to run a Visual Studio NX journal:
- Build a .dll, not an .exe.
- To run from (interactive) NX use Ctrl-U and select your dll.
If you start from one of the Visual Studio NX Open Wizards project templates then the VS project will be correctly set up and you can...
Looks like you should check if the assembly has any components before using OrdersSet().
You could try:
if (theNxDataController.NXPart.ComponentAssembly.RootComponent == null)
&& (theNxDataController.NXPart.ComponentAssembly.RootComponent.GetChildren().Length == 0)...
I believe that you can use the User Exits to have a dll executed at particular times automatically by NX.
We run NX Open with Visual Studio and when you use the template NX9 Open c# Wizard it creates a ReadMe.txt, that I have attached to this post, which describes these User Exits.
E.g.
User...
Here's how we roll:
1) In VS build your .dll.
2) In Project Properties, under Debug, set Start External program to C:\Program Files\Siemens\NX 10.0\UGII\ugraf.exe (or similar).
3) "Start" in VS will then launch NX.
4) Ctrl-U in NX to select and run your .dll.
5) Breakpoints will be hit...
CNZSU,
You have the parameters in SetSelectionFilter mixed up.
The second is SelectionAction but you have put the selectionFilter in there. You need to put EnableAll in the third parameter.
Paul
Paul Turner
CAD & Process Engineer
Mastip Technology
NX has the ability to handle very large assemblies if you follow a few rules.
Here is one approach that I have used in the past to manage assemblies with thousands of parts (up to tens of thousands). Presumably if you have many parts you have many users working on these.
Use Reference Sets...
Is the iterator stepping through the components?
Is ++ implemented for NXOpen::Assemblies::Component?
What do you see if you add the component name to the list->WriteLine("inside loop");? Is it stepping through the components?
Paul
Paul Turner
CAD & Process Engineer
Mastip Technology
The journal below will load a .cdf into a part. It also sets the background colours and the selection colours (to NX10 defaults).
It processes all the parts in the displayed part assembly.
We use this to update old files from NX4 (with 1990's AutoCAD style black background) to NX10 colour...
We did something like this previously (recall from memory):
You have an Item Master Form in TC, that has your custom attributes defined. Then you also have an Item Revision Form that has some other of your attributes defined. Note that some may be Item level and some Revision level. We had our...
OK this explains why when you run the Convert Mating Conditions (e.g. NX4 files -> NX10) a Fix constraint is added to one part in some assemblies.
Paul Turner
CAD & Process Engineer
Mastip Technology
Hi Graham,
Thanks for the reply.
I need an object reference to be able to set its BackgroundType.
I can't just call:
NXOpen.Display.Background.BackgroundType = Background.Type.Graduated
So my question is how do I get the object reference for the current display?
Paul Turner
CAD &...
Hello NXers,
We are upgrading from NX4 to NX10 and all the existing files have black backgrounds, white as the selection colour and the old colour palettes.
I am doing a journal to change these in one operation. The current look is a bit too 90s AutoCAD.
This previous post discusses this...