TheSwamp

Code Red => .NET => Topic started by: Odoshi on February 08, 2011, 07:51:48 AM

Title: Drawables from Blocks
Post by: Odoshi 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
Title: Re: Drawables from Blocks
Post by: LE3 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...
Title: Re: Drawables from Blocks
Post by: n.yuan on February 08, 2011, 04:26:53 PM
Yes, it is possible. See this video clip http://screencast.com/t/fRSgSyxCrz (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.