.NET

Reply
*GPaolo
Message 1 of 1 (45 Views)

MANTAIN THE GROUPS AFTER INSERT BLOCK

45 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?
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!