.NET

Reply
Distinguished Contributor
HJohn1
Posts: 170
Registered: ‎09-26-2008
Message 1 of 5 (235 Views)
Accepted Solution

Mirror BlockReference on UCS

235 Views, 4 Replies
08-09-2013 11:15 AM

I having problems mirroring blockreferences when the active coordinate system is not the WCS.  We are mirroring through the base point of the blockreference.  On the WCS I am doing this:

 

Pt = Blk.Position.Add(New Vector3d(0, 50, 0))

lin = New Line3d(Blk.Position, Pt)

Blk.TransformBy(Matrix3d.Mirroring(lin))

 For the WCS it works very well, however when the current coordinate system is a UCS then it does not work.  I have tried this:

 

mtrx = Ed.CurrentUserCoordinateSystem

Dim vt As New Vector3d(0, 50, 0)

'vt.TransformBy(mtrx)

Pt = Blk.Position.Add(vt)

lin = New Line3d(InsPt, Pt)

lin.TransformBy(mtrx)

Blk.TransformBy(Matrix3d.Mirroring(lin))

 I think my problem is the end point of the line, pt.  I tried to transform the vt but that does not work either.  Can someone please help me here.  Thanks in advance.

 

Hi,

 

If I don't misunderstand, you want to mirror a block about a line parallel to the current UCS Y axis which containd the block position.

 

Vector3d vt = Vector3d.YAxis.TransformBy(ed.CurrentUserCoordinateSystem)
Blk.TransformBy(Matrix3d.Mirroring(new Line3d(Blk.Position, Blk.Position + vt)))

 

*Expert Elite*
_gile
Posts: 2,133
Registered: ‎04-29-2006
Message 2 of 5 (209 Views)

Re : Mirror BlockReference on UCS

08-10-2013 03:48 AM in reply to: HJohn1

Hi,

 

If I don't misunderstand, you want to mirror a block about a line parallel to the current UCS Y axis which containd the block position.

 

Vector3d vt = Vector3d.YAxis.TransformBy(ed.CurrentUserCoordinateSystem)
Blk.TransformBy(Matrix3d.Mirroring(new Line3d(Blk.Position, Blk.Position + vt)))

 

Gilles Chanteau
Distinguished Contributor
HJohn1
Posts: 170
Registered: ‎09-26-2008
Message 3 of 5 (200 Views)

Re : Mirror BlockReference on UCS

08-10-2013 05:54 AM in reply to: _gile

Thank you very much _gile this is exactly what I was trying to do.  I was going to use the Matrix3d.Mirroring(Plane) method.  How do I get the Yaxis Plane of the current coordinate system?

*Expert Elite*
_gile
Posts: 2,133
Registered: ‎04-29-2006
Message 4 of 5 (191 Views)

Re : Re : Mirror BlockReference on UCS

08-10-2013 08:04 AM in reply to: HJohn1
Plane plane = new Plane(br.Position, Vector3d.XAxis.TransformBy(ed.CurrentUserCoordinateSystem));
Blk.TransformBy(Matrix3d.Mirroring(plane));

 

Gilles Chanteau
Distinguished Contributor
HJohn1
Posts: 170
Registered: ‎09-26-2008
Message 5 of 5 (148 Views)

Re : Re : Mirror BlockReference on UCS

08-12-2013 06:25 AM in reply to: _gile

Thank you very much _gile.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.