TheSwamp

Code Red => .NET => Topic started by: A_LOTA_NOTA on April 05, 2011, 04:34:33 PM

Title: Block Scale Factor C#
Post by: A_LOTA_NOTA on April 05, 2011, 04:34:33 PM
Once I have selected the block, how do I read it's scale factor?

Edit:

I think I found what I was wanting

Code: [Select]
BlockReference myBRef = (BlockReference)tr.GetObject(acDb.BlockTableId, OpenMode.ForRead);
                double ScaleX = myBRef.ScaleFactors.X;
                double ScaleY = myBRef.ScaleFactors.Y;
                double ScaleZ = myBRef.ScaleFactors.Z;
Title: Re: Block Scale Factor C#
Post by: A_LOTA_NOTA on April 06, 2011, 08:08:35 AM
Code: [Select]
BlockReference myBRef = (BlockReference)tr.GetObject(acDb.BlockTableId, OpenMode.ForRead);
                double ScaleX = myBRef.ScaleFactors.X;
                double ScaleY = myBRef.ScaleFactors.Y;
                double ScaleZ = myBRef.ScaleFactors.Z;

So these are read only properties? How would I change the scale if I wanted?

Thank for your help
Title: Re: Block Scale Factor C#
Post by: gile on April 06, 2011, 08:27:18 AM
Hi,

Code: [Select]
br.ScaleFactors = new Scale3d(scaleX, scaleY, scaleZ);
If you want to play with block insertions, take a look to the samples in this thread (http://www.theswamp.org/index.php?topic=37686.0).
Title: Re: Block Scale Factor C#
Post by: A_LOTA_NOTA on April 06, 2011, 09:13:04 AM
Thank you for your help Gile.