Hi Brian,
> Remark: cPlane1 is not a CPlane, it is actually a ptframe. 2D or 3d or pseudo 2D ???
"cplane" and "ptframe" are not distinct object types, they are both instances of a MoiCoordinateFrame object that contains an origin point and x/y/z axis directions forming a coordinate system.
When you access the pointpicker.cplane property, that will return a MoiCoordinateFrame object set to the local cplane for the viewport that the mouse was clicked in. That's the same as the grid you see inside of a viewport.
When you access the pointpicker.ptframe property, that returns a MoiCoordinateFrame object that has the x/y/z axis directions of the viewport's cplane but it's origin point is placed at the picked point. It's the same as if you used pointpicker.cplane but then set the .origin property of that frame to the picked point (pointpicker.pt).
re:
code:
var cPlane2 = pointpicker.ptframe.setBasePt(lastPt); //This code throws error, Not a constructor.<<<<<<<<<<<
So the reason why this throws an error is that you'll be getting a MoiCoordinateFrame object returned back from the pointpicker.ptframe part of the code, and then you're trying to call a function setBasePt on it. But there is no function setBasePt on a MoiCoordinateFrame object, it's the pointpicker that has a setBasePt() function in it.
The pointpicker setBasePt() takes a point in world coordinates to use as the base point for the current pick. Things like straight snap use the base point, it's usually set in things like drawing a line for the 2nd pick of the line. The point from the first pick is set at the base point and that will then set up straight snaps which go through the base point.
Does any of that help? I'm not really sure what it is that you're trying to do at that point in the script so it's a little difficult for me to tell you exactly what the code is supposed to be right there.
But if it's the second point of a picking sequence that is meant to behave like the line command with straight snaps active from the previous point pick, that's what you would use setBasePt() on the pointpicker to set up.
- Michael