How to get the coordinates of tree diferent points?

Status
Not open for further replies.

Crigui

Usenet Archive
Joined
Sep 28, 2001
Messages
39
Reaction score
0
Hi,

How to get the coordinates of tree diferent points? We are drawing a line and want to get the sides of it. If we give a third point , choosing the side that we want, we could to that. But to compare this third point with the line, we need all the coodernates of them!

We are almost doing it, but sometimes, i mean, some cases, it doesn't work.

If somebody could help us...
Thanks anyway...

Guilherme and Cristiano
 
Guilherme and Cristiano ...

How to get the coordinates of tree diferent points? We are drawing a line and want to get the sides of it. If we give a third point , choosing the side that we want, we could to that. But to compare this third point with the line, we need all the coodernates of them!

Is your problem that you want to compute on which side of a line the third point lies?

You can perform calculations like this in a dynamics function. A dynamics function is called by MicroStation during a primitive operation (that is, between the time that a user starts your command and the <datapoint> event).

For example:
cmdLineAndPoint (void) {
int needPoints = 1;
mdlState_startModifyCommand (, , , , FALSE, needPoints); // Set your locate logic to find a line element mdlLocate_xxx;

// Set a dynamics function
mdlState_setFunction (STATE_COMPLEX_DYNAMICS,
state_dynamicsUserPoint);
}

void dynamicsUserPoint
(
DPoint3d *pt, // => Current cursor position int view ) { // The user has located a line by the time your function is called int fileNum = 0; ULong filePos = mdlElement_getFilePos (FILEPOS_CURRENT, &fileNum); MSElement line; DPoint3d points [MAX_VERTICES]; int nPoints = 0;

mdlElement_read (&line, fileNum, filePos);
// Get vertices from line
mdlLinear_extract (points, &nPoints, &line, fileNum);

// Now you have the vertices of the line and the current // user cursor position }
 
"Crigui" wrote:

Hi,

How to get the coordinates of tree diferent points? We are drawing a line and want to get the sides of it. If we give a third point , choosing the side that we want, we could to that. But to compare this third point with the line, we need all the coodernates of them!

We are almost doing it, but sometimes, i mean, some cases, it doesn't work.

If somebody could help us...
...

hi there

if you are using basic there is the mbe.getendpoints command below is a code fragment.

this is used with the mberelocate command after placing the line.

If element.getEndPoints (startPoint, endPoint) = MBE_Success Then

if startpoint.x = endpoint.x then
angle = pi/2
else
test1 = endpoint.y - startpoint.y
test2 = endpoint.x - startpoint.x
result = test1 / test2
ANGLE = ATN(result)
end if

MBESETTINGS.ANGLE = angle

hope this helps
hugh
 
Status
Not open for further replies.

Latest threads

Back
Top