Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

"Do loop" in NX 1

Status
Not open for further replies.

ilkea

Aerospace
Apr 7, 2006
9
Hi,

assume that I have a solid body with a relatively complex geometry with volume = V

what I would like to do is to offset one face deltax and calculate the new volume (Vnew) and write this volume to a file and repeat this step for n times...

I assume this is possible in NX but I dont know how to, I will be glad if you post a similar code, so that I can modify it to match my needs

well, I am not familiar to VB or C++ but the algorithm should do something like below

deltax= 0.1

do i=1,100
offsetvalue = deltax X i
//update the model with new offset value, obtain the new solid//
//re-calculate the volume = Vnew //

Volume(i) = Vnew (not neccassarily in array form, any non-confusing data/file type is OK)
end do
exit

Thanks in advance...
 
Replies continue below

Recommended for you

What are you trying to do? Is it to solve for the amount of offset until the correct volume is reached?

Best Regards

Hudson

www.jamb.com.au

Nil Desperandum illegitimi non carborundum
 

well actually no...
What I am triyng to do is to get the change of the volume (or the rate of the change of the volume) with increasing offset distance. I am trying to do this in NX because as I said the geometry is relatively complex thus I can not calculate it analytically... At the end of this study my goal is to plot deltax versus volume graph.

Thanks.
 
Hi,
What about using Tools/Spreadsheet ?
Have you any experience with Excel ?
if not, here is the way to update the model with office 2007
assign a name to your solid
Tools / Spreadsheet
Tab / Complements or maybe add on in english
Extract expression
Add anywhere the formula: =mass3d("name of the solid";2;3)
Change the parameter deltax
Tab / Complements
Update NX
Then find a way to do a loop and a graph in Excel

Regards

Didier
 

Attached is c# journal.

In your part file create your first offset and note down the expression name for the offset value. Also, create a measure body by clicking the associative option on. For that measure body feature note down the expression name for the volume.

In the journal file replace the name of the expressions with the corresponding expression names in your part file.

When you run the journal the results are listed to the listing window.

Hope this helps.

Suresh
www.technisites.com.au
 
 http://files.engineering.com/getfile.aspx?folder=42ec6894-b579-4616-bb0b-a20c2f004ca2&file=report_vol.cs
ExpertNX & ufsure thanks for your helpful posts...

I am out of office now but I will try both methods as soon as possible and let you know about the results...

Thanks again..

best regards.
 
Looks like you do not have that expression in your part file. Make sure on line 21 of the original journal file you replace p398 with the name of your expression. Include the inverted commas.

Suresh
 
I tried the journal but unfortunately I got error messages similar to those that ExpertNXs'
I am working on the journal, I will let you know if I can figure out the problem...

Best regards

i.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor