InsertBlock method - COM

When using the "InsertBlock" method changing the rotation does not seem to have any effect. With the following exception ...Setting the rotation to "0" as in the help file example fails to insert a block.I am using version 6.2.0020.One other obsevation "singlton" does not seem to do anything as multiple sessions still occur ... or is this not its intent?

Comments

  • Richard,I created a block called 'Mickey' in my drawing. (V6.2.0020)Following code inserts that block with 45 degree rotation; After a 'Regen' the rotation gets reversed.Pretty useless code but if you step through it with F8 you should see how it works. No rotation problem as far as I can see. Hope this helps.ArnoPublic Sub InsertBlock() Dim Blockref As IntelliCAD.BlockInsert Dim InsPnt As New IntelliCAD.Point InsPnt.x = 0 InsPnt.y = 0 InsPnt.z = 0 Set Blockref = IntelliCAD.ActiveDocument.ModelSpace.InsertBlock(InsPnt, "Mickey", 1, 1, 1, 45 * 3.141592 / 180) IntelliCAD.ActiveDocument.Regen vicAllViewports Blockref.Rotation = -Blockref.Rotation IntelliCAD.ActiveDocument.Regen vicAllViewports End Sub

  • Thanks for the reply.I found my mistake. I was using the example in the help-file.......Set blockRefObj = ThisDocument.ModelSpace.InsertBlock(insPt, BlkName, 1, 1, 0)......The "ZSCALE" is missing!!Thanks againRick

  • This error in the example will be corrected in the next release.

  • Maybe some of you can help me with this block problem:How can we redifine a block in the same manner as we do manually with the command "insert blockname=". I tried this: Dwg=Activedocument InsPt=Library.CreatePoint(0, 0, 0) DwgName = "C:\BlockTest.dwg" Dwg.ModelSpace.InsertBlock InsPt, DwgName If the block with name DwgName (without the path) allready exists it's not redfined. I also tried Dwg.ModelSpace.InsertBlock InsPt, BlkName &"=" &DwgName without luck. However, this works: (blk=existing block reference) RunCommand "insert " & blk.Name & "=" & blk.Name RunCommand "0,0" RunCommand "1" RunCommand "1" RunCommand "0" Now the block is redifned, but it's not very elegant.... We also have the problem that VBA doesn't wait for RunCommand to finnish... Any ideas?

This discussion has been closed.