Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Variable Radius Macro

Status
Not open for further replies.

John2025

Industrial
Sep 12, 2007
321
Hi Guys,
I'm working in 7.0 (7.5 as soon as I find the time to install). I have a part that needs lots of individual blended radii that are variable. I can do them one at a time but it's going to take a long time and is quite tedious. This seems like a place for a macro. Before I reinvent the wheel, has anyone created something like this? I'ld like to be able to pick an edge and have NX automatically put X size radius at one end and Y size radius at the other end. This is a fairly common operation for the types of parts we make.
Thanks,
JohnK
 
Replies continue below

Recommended for you

I think the best general approach is to record a journal, and then generalize it so that you can pick any edge. I don't have the code to do it, but that's the general idea. You'll need somebody with some experience in the .net API, or download a sample from GTAC that does something similar.

For example, in the journal you recored you will find commands like these to set the variable radius points:

Dim vrIndex1 As Integer
vrIndex1 = edgeBlendBuilder1.AddVariableRadiusDataNew(edge1, "86.0213654142479", "15", nullPoint, False, False)

Dim vrIndex2 As Integer
vrIndex2 = edgeBlendBuilder1.AddVariableRadiusDataNew(edge1, "33.9512213112124", "7", nullPoint, False, False)

Dim vrIndex3 As Integer
vrIndex3 = edgeBlendBuilder1.AddVariableRadiusDataNew(edge1, "100", "10", nullPoint, False, False)

Dim vrIndex4 As Integer
vrIndex4 = edgeBlendBuilder1.AddVariableRadiusDataNew(edge1, "0", "10", nullPoint, False, False)



Mark Rief
Product Manager
Siemens PLM
 
Mark,
I've done a little work in .NET on occasion and I see a few examples on this site that should help. Do you know where I can find some documentation on the functions and procedures that NX has built-in? I looked on GTAC but I don't see anything. I can see where the journal capabilities can be really helpful.
Thanks,
JohnK
 
Help --> NX Help
Automation --> NX Open --> Open for .NET



Mark Rief
Product Manager
Siemens PLM
 
I got this to work the way I wanted. Journals and .Net are very cool. The only thing that I'd like to improve is the time it takes to start. When I click on the custom command button I created, it takes maybe 10 secs to start. NX says "working". Once the first Input box comes up it's very quick. It seems like maybe it's interpreting the code each time. Is there a way to compile the journal file for a faster start? This is really minor as the operation is excellent after the initial wait.
Thanks,
John
 
Yes. Once a journal has been created, you can use something like Visual Basic to 'convert' it into an actual executable program, but that will require an NX Open development license.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
I can't really justify the license for just a few seconds. Just knowing the reason makes me feel better. It's interesting though, the first time I run it takes about 7 sec on my machine, but subsequent runs only take about 2 sec. Maybe it caches it. Anyway, thanks for the help, it's a great feature.
John
 
What happens is that the first time you run it, as you suspected, it's running it through the interpreter. But once that's done it's almost as if you had done a build and that is what gets 'cached', this 'executable' version of the journal, which will remain available until you exit the session. We do that same thing with dialogs. You can see this with something like the 'Hole Feature' where a lot of data is needed to first establish the dialog and all the settings. But subsequent selections of the function are a bit quicker. In some cases we actually save the cache for later use even in another session. The best example of that is the 'Command Finder' where the first time you open this dialog after installing a version of NX, it can take 20 or 30 seconds, maybe longer (it has to create an index of all the function names used in NX before it can do it's first 'find').

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor