"Do loop" in NX
"Do loop" in NX
(OP)
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...
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...





RE: "Do loop" in NX
Best Regards
Hudson
www.jamb.com.au
Nil Desperandum illegitimi non carborundum
RE: "Do loop" in NX
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.
RE: "Do loop" in NX
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
RE: "Do loop" in NX
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
RE: "Do loop" in NX
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.
RE: "Do loop" in NX
I try using your program. I have done the request about the 2 expressions to be renamed. But have a look at the error message in the attached file.
Regards
Didier
RE: "Do loop" in NX
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
www.technisites.com.au
RE: "Do loop" in NX
I am working on the journal, I will let you know if I can figure out the problem...
Best regards
i.
RE: "Do loop" in NX
If you can post your part file I may be able to look at the problem. Thia journal was created in NX 6.0.2.8.
Suresh
www.technisites.com.au