AnsweredAssumed Answered

Drawing: create new instances of inserted sketch blocks

Question asked by Christoph Neundorf on Jan 2, 2014
Latest reply on Jan 2, 2014 by Christoph Neundorf

Hi all,

 

i'm trying to create new instances of an already inserted sketch block (Block.sldblk) on a drawing.

But unfortunately it doesn't work yet.

 

Here's the snippet:

 

            swSketchMgr = ActiveModel.SketchManager;

            oSketchBlockDefs = (object[])swSketchMgr.GetSketchBlockDefinitions();

            foreach (object oblockDef in oSketchBlockDefs)

            {

                blockdef = (SketchBlockDefinition)oblockDef;

                string blockfilename = blockdef.FileName;

                if (blockfilename != null)

                {

                    if (blockfilename.Contains("Block.sldblk"))

                    {

                        swBlockInst = swSketchMgr.InsertSketchBlockInstance(blockdef, swMathPoint, 0, 0);

                        ActiveModel.GraphicsRedraw2();

                     }

                }

            }    

 

Any thoughts?

 

Thanks,

Christoph

Outcomes