Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NX Journal - get line parameters from a sketch

Status
Not open for further replies.

MrLLH

Mechanical
Oct 31, 2012
3
Hi there, I've been trying to write a journal that will get the angle of a number of lines in a sketch.

I was able to find an example online where I could get the line length using a journal (see
I thought it would be as simple as changing the line in that Journal from

lw.WriteLine("line length: " & tempLine.GetLength.ToString)

to

lw.WriteLine("line length: " & tempLine.Get[highlight #FCE94F]Angle[/highlight].ToString)

but that doesn't work. The screenshot below shows the result of the information window on one of the lines I'm trying to get the information on, which clearly shows the Length and Angle. So if GetLength works, why doesn't GetAngle work???

Thanks in advance for your help

Capture_d68q77.jpg
 
Replies continue below

Recommended for you

MrLLH said:
So if GetLength works, why doesn't GetAngle work???

The line object has a .GetLength method that will return the length of the line; however, it does not have a .GetAngle method. The angle a line makes is not an intrinsic property of the line, you need another object to reference to measure an angle. In the information output, NX has calculated the angle of your sketch line to the sketch horizontal reference and reported the value. NXOpen has some methods for measuring angles, or you can use some trigonometry to calculate it yourself.

www.nxjournaling.com
 
Thanks for the confirmation. I was hoping that since it was something NX reported in the info window that it could easily make that available to the journal.

Thanks anyway. I'll keep trying :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor