AnsweredAssumed Answered

SketchManager:: MakeSketchBlockFromFile returns null

Question asked by Joecel Torres on Feb 5, 2015

Hello Everyone,

After executing the following code, the block is successfully inserted on the drawing file.

MathUtility mathUtil = (MathUtility)swApp.GetMathUtility();
SketchManager sktMngr = swDocModel.SketchManager; 
MathPoint mathPt;
BlockDefinition blockDef;
mathPt = (MathPoint)mathUtil.CreatePoint(new double[3] { .265 * scale[1], blockY * scale[1], 0 });
blockDef = (BlockDefinition)sktMngr.MakeSketchBlockFromFile(mathPt, @"C:\Solidworks Common\blocks\W3.SLDBLK", false, .5, 0);

 

Problem: blockDef is null even if the block was successfully inserted.

What is the possible cause of this problem?

 

Hoping anyone could help.

Thanks in advance.

 

Best regard,

Joecel

Outcomes