Hi All,
I have to knock out a quick modeling app similar to this, I don't have time to do it in a LL language and it will be more of a prototype to be ported later if all works well.
Anyway, I've borrowed some of Duh's code and I have a small problem, I have a library of shapes as polylines already to go, what I want to do is insert the polyline as a block, explode it to get the polyline and extrude it but I'm getting a 'self reference' error, here's the code so far.
Public Sub DrawSection()
Dim oLayer As AcadLayer
Dim oBeam As Acad3DSolid, oReg As AcadRegion, oBlock As AcadBlockReference, oObject As Variant
Dim Inspt As Variant
Dim RegEnt(0) As AcadEntity
Set oLayer = ThisDrawing.Layers.Add("3D-mbr")
oLayer.color = 235
Inspt = ThisDrawing.Utility.GetPoint(, "Pick Insertion Point: ")
Set oBlock = ThisDrawing.ModelSpace.InsertBlock(Inspt, "C:\DCS3d\310UB040.dwg", 1#, 1#, 1#, 0) '<--self ref error here
ThisDrawing.Regen acActiveViewport
Set oObject = oBlock.Explode
ThisDrawing.Regen acActiveViewport
Set RegEnt(0) = oObject
oReg = ThisDrawing.ModelSpace.AddRegion(RegEnt)
Set oBeam = ThisDrawing.ModelSpace.AddExtrudedSolid(oReg(0), 1000, 0)
oReg(0).Delete
End Sub
Once I get this sorted I will add code to look up the file by name and let the user select the appropriate section, add some data to it for BOM's and manipulation and transform it into it's final place.
tia,
Mick.