Author Topic: Block Scale Factor C#  (Read 4331 times)

0 Members and 1 Guest are viewing this topic.

A_LOTA_NOTA

  • Guest
Block Scale Factor C#
« 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;
« Last Edit: April 05, 2011, 05:05:09 PM by A_LOTA_NOTA »

A_LOTA_NOTA

  • Guest
Re: Block Scale Factor C#
« Reply #1 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

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Block Scale Factor C#
« Reply #2 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.
Speaking English as a French Frog

A_LOTA_NOTA

  • Guest
Re: Block Scale Factor C#
« Reply #3 on: April 06, 2011, 09:13:04 AM »
Thank you for your help Gile.