.NET

Reply
*GPaolo
Message 1 of 1 (43 Views)

MANTAIN THE GROUPS AFTER INSERT BLOCK

43 Views, 0 Replies
11-24-2005 11:18 PM
hello.


i use acad2006

I have a part named part1.dwg that contain some enities that are grouped in
the group test now i want
make a insertblock and explode it but i want mantain the previos group.

If i make this operation by line command without automatik explode and that
explode by command all is ok.
But if i make the same operation by program don't work.

----------------------------------------------------
First version:
Try

p1(0) = 0

p1(1) = 0

p1(2) = 0

BlockRef = AcInt.AcadDoc.ModelSpace.InsertBlock(p1, "c:\part1.dwg"1, 1, 0.0)

Block = AcInt.AcadDoc.Blocks.Item(BlockRef.Name)

BlockRef.Explode()

BlockRef.Delete()

Block.Delete()

Catch ex As Exception

MessageBox.Show(ex.Message)

Finally

AcInt.AcadApp.ZoomExtents()

BlockRef = Nothing

Block = Nothing

End Try

'---------------------------

second version

This version have work until acad2005

now don't work

'----------------------------------

Try

p1(0) = 0

p1(1) = 0

p1(2) = 0

BlockRef = AcInt.AcadDoc.ModelSpace.InsertBlock(p1, "c:\part1.dwg",1, 1,
0.0)

Block = AcInt.AcadDoc.Blocks.Item(BlockRef.Name)

J = -1

ReDim CollObj(Block.Count - 1)

For Each Obj In Block

J += 1

CollObj(J) = Obj

Next Obj

RetVal = AcInt.AcadDoc.CopyObjects(CollObj, AcInt.AcadDoc.ModelSpace, )

For J = 0 To UBound(RetVal)

Obj = RetVal(J)

Obj.ScaleEntity(p1, scalex)

Obj.Move(p1, insertionpnt)

Obj.Rotate(insertionpnt, degrad(rot))

Next

BlockRef.Delete()

Block.Delete()

Catch ex As Exception

MessageBox.Show(ex.Message)

Finally

AcInt.AcadApp.ZoomExtents()

BlockRef = Nothing

Block = Nothing

RetVal = Nothing

End Try

------------------------------------------------------

is possible changed the ownerid of the enities in the blockdefinition and
put modelspace?



Now both the solution dont work.

Some help?
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.