Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
in the dwg,two blockreference has same name ,same rotation.
but why do they have different shape, different basepoint ?
Solved! Go to Solution.
in the dwg,two blockreference has same name ,same rotation.
but why do they have different shape, different basepoint ?
Solved! Go to Solution.
Hi,
The block on the left does not lies on the XY plane, its normal is: 0.0168726, 0.0, 0.999858 (slightly rotated on Y axis).
The Rotation property of a block reference is measuered about the X axis of the Object Corrdinate System (OCS).
How to reproduce this problem。
do you mean
1。first, set a ocs, forexamble, its Zaxis is (a,b,c).
2。second ,insert a blockreference in the OCS ?
I DON'T know how to draw. could you give a Operation video ---Screen recording。
thank you .
great!!!
thank your very much.
another problem:
the left blockreference is not drawed in wcs.
how to get the four point(X,Y,z) of the rectangle in wcs
@wokeyiyognshenme a écrit :
the left blockreference is not drawed in wcs.
how to get the four point(X,Y,z) of the rectangle in wcs
You can either get the coordinates of the polyline by exploding the block reference or from the block definition.
public static Point3dCollection GetPolylineCoordinates(Polyline pline)
{
var points = new Point3dCollection();
for (int i = 0; i < pline.NumberOfVertices; i++)
{
points.Add(pline.GetPoint3dAt(i));
}
return points;
}
private static Point3dCollection GetPolylineCoordinatesByExploding(BlockReference br)
{
var entitySet = new DBObjectCollection();
br.Explode(entitySet);
var points = new Point3dCollection();
foreach (Entity entity in entitySet)
{
if (entity is Polyline pline)
{
points = GetPolylineCoordinates(pline);
}
entity.Dispose();
}
return points;
}
private static Point3dCollection GetPolylineCoordinatesFromBlockDefinition(BlockReference br)
{
var btr = (BlockTableRecord)br.BlockTableRecord.GetObject(OpenMode.ForRead);
var points = new Point3dCollection();
foreach (ObjectId id in btr)
{
if (id.ObjectClass.Name == "AcDbPolyline")
{
var pline = (Polyline)id.GetObject(OpenMode.ForRead);
foreach (Point3d point in GetPolylineCoordinates(pline))
{
points.Add(point.TransformBy(br.BlockTransform));
}
}
}
return points;
}
thankyou very much