Author Topic: Drawables from Blocks  (Read 1500 times)

0 Members and 1 Guest are viewing this topic.

Odoshi

  • Guest
Drawables from Blocks
« on: February 08, 2011, 07:51:48 AM »
Hi everyone,

I have another....

I want to draw graphics that represent my block using TransientManager.

I have the following, but nothing is drawn:

if (idBlock != ObjectId.Null)
                {
                    obj = (Autodesk.AutoCAD.GraphicsInterface.Drawable)new BlockReference(new Point3d(0.0, 0.0, 0.0), idBlock);
                    tm.AddTransient(obj, Autodesk.AutoCAD.GraphicsInterface.TransientDrawingMode.DirectTopmost, 0, ints);
                    _drawn.Add(obj);
                }

Is this possible? It works fine with simple objects, like lines.

Thanks,
Mike

LE3

  • Guest
Re: Drawables from Blocks
« Reply #1 on: February 08, 2011, 02:35:18 PM »
Never got the chance to implement this, have seen the arx sample under arx sdk 2009 - and recall reading something about it here in the .NET section of the swamp some moons ago... don't have any link...

n.yuan

  • Bull Frog
  • Posts: 348
Re: Drawables from Blocks
« Reply #2 on: February 08, 2011, 04:26:53 PM »
Yes, it is possible. See this video clip http://screencast.com/t/fRSgSyxCrz.

In the code, I let user pick a block, then I call Entity.Clone to create an cloned entity for the Transient Graphics. That is, it does not matter the Drawable is an Entity, or a BlockReference.