.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MANTAIN THE GROUPS AFTER INSERT BLOCK

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
137 Views, 0 Replies

MANTAIN THE GROUPS AFTER INSERT BLOCK

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?
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost