0
  Dim ACone As New Solid
            ACone = Solid.CreateCone(5, 5, New Point3D(0, 0, 0), New Point3D(0, 0, 50), 20)
            DisplayEyeshotBlock.Entities.Add(ACone)

            Dim BCone As New Solid
            BCone = Solid.CreateCone(5, 5, New Point3D(50, 0, 0), New Point3D(50, 0, 50), 20)
            DisplayEyeshotBlock.Entities.Add(BCone)

I want to combine two solids (or more) into one solid in devDept Eyeshot, so that when i apply rotation (translation etc), each will get this transformation. The solids can be widely separated.Just like the two cones(in the code) which i want to combine into one solid. Am unable to do so and thanks in advance.

Anas Ahmed
  • 123
  • 9

1 Answers1

1

You need to use blocks. a block is an entity that does not have a visual representation itself but it contain a List<Entity> which those are visible object.

The simple method using your code first create your 2 solids

Dim ACone As New Solid
ACone = Solid.CreateCone(5, 5, New Point3D(0, 0, 0), New Point3D(0, 0, 50), 20)

Dim BCone As New Solid
BCone = Solid.CreateCone(5, 5, New Point3D(50, 0, 0), New Point3D(50, 0, 50), 20)

then create a block object which will hold your 2 solids

Dim singleBlock As New Block("name")
singleBlock.Entities.Add(ACone)
singleBlock.Entities.Add(BCone)
MyViewport.Blocks.Add(singleBlock)

now in order to use this block you cannot add it directly into the viewport. To do that you need a BlockReference which points to a block you just added.

Dim blockRef As New BlockReference("name")
MyViewport.Entities.Add(blockRef);

that block reference object is the object that you want to move/rotate (apply transformation) around the world

The code might not be in working condition as i rarely use VB.Net but it should be pretty close. The class names and order of action are correct though.

Franck
  • 4,438
  • 1
  • 28
  • 55