Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Measuring along only the positive value of the direction

Status
Not open for further replies.

solid7

Mechanical
Jun 7, 2005
1,403
0
0
US
I'm trying to use distancedir to measure along a direction. No problem, it works fine. Except what I really want to do, is invert the direction in the next iteration, and get the measure of all of a certain feature in the other direction.

For me, a direction should dictate only positive values. (or give the option to return absolute) However, all values are absolute. Here is my intention:

Code:
		If angle( direction( ioLine ) , direction( ioTestLine ) ) == 0deg OR
			angle( direction( ioLine ) , direction( ioTestLine ) ) == 180deg
		{
			ioMeasDirLine = lineangle( ioTestLine , ioPlane , ioCoG , False , 0in , 1in , 90deg , True )
			ioMeasDir = direction( ioMeasDirLine )
			ioMeasDir1 = distancedir( ioTestLine , ioLine , ioMeasDir )
			
			set ioMeasDirLine = invert( ioMeasDirLine )
			ioMeasDir = direction( ioMeasDirLine )
			ioMeasDir2 = distancedir( ioTestLine , ioLine , ioMeasDir )
			
			ioMeasList1 ->Append( ioMeasDir1 )
			ioMeasList2 ->Append( ioMeasDir2 )
			
			Message( "ioMeasDir1 = # : ioMeasDir2 = #" , ioMeasDir1 , ioMeasDir2 )
		}

The only way that I have found to circumvent this problem, is to offset parallel lines in both directions, and measure backwards, then offset, test, and reverse offset, if not correct the 1st time. That's a pain. Too many calculations.

Anybody got a more clever way to accomplish this?

Thank you.

 
Status
Not open for further replies.
Back
Top