Here is an example what you looking for
I don't like to use command line for entering
values, so I used InputBox instead:
- Sub DrawFrameTest()Dim strMStyle As StringDim structWid As DoubleDim frameWid As DoubleDim structHgt As DoubleDim frameHgt As DoubleDim beamWid As DoubleDim hnum As IntegerDim vnum As IntegerDim varpt As VariantDim hstep As DoubleDim vstep As DoubleDim pts(5) As DoubleDim movept(2) As DoubleDim oMLine As AcadMLineDim cMline As AcadMLineDim cnt As IntegerstrMStyle = "STANDARD"structWid = CDbl(InputBox("Structural Opening Width:", "Structural Width", "7733.0"))frameWid = CDbl(InputBox("Frame Width:", "Frame Width", "7712.0"))structHgt = CDbl(InputBox("Structural Opening Height:", "Structural Height", "2986.0"))frameHgt = CDbl(InputBox("Frame Height:", "Frame Height", "2966.0"))beamWid = CDbl(InputBox("Beam Width:", "Beam Width", "50.0"))ThisDrawing.SetVariable "CMLJUST", 1ThisDrawing.SetVariable "CMLSTYLE", strMStylehnum = CInt(InputBox("Number Of Horizontal Beams:", "Horizontal Beams", "4"))vnum = CInt(InputBox("Number Of Vertical Beams:", "Vertical Beams", "4"))varpt = ThisDrawing.Utility.GetPoint(, vbCr & "Pick lower left point of construction:")ThisDrawing.Regen acActiveViewport'calculationshstep = (frameWid - (beamWid * vnum)) / (vnum - 1)vstep = (frameHgt - (beamWid * hnum)) / (hnum - 1)pts(0) = varpt(0) - beamWid: pts(1) = varpt(1) + beamWid / 2: pts(2) = 0#pts(3) = pts(0) + frameWid: pts(4) = pts(1): pts(5) = 0#'horizontal beamsSet oMLine = ThisDrawing.ModelSpace.AddMLine(pts)oMLine.MLineScale = beamWidoMLine.UpdateDo While cnt < hnum - 1Set cMline = oMLine.CopycMline.MLineScale = beamWidcMline.Updatemovept(0) = varpt(0)movept(1) = varpt(1) + (cnt + 1) * (vstep + beamWid)movept(2) = 0#cMline.Move varpt, moveptcnt = cnt + 1Loop'vertical beamscnt = 0pts(0) = varpt(0) - beamWid / 2: pts(1) = varpt(1): pts(2) = 0#pts(3) = pts(0): pts(4) = pts(1) + frameHgt: pts(5) = 0#Set oMLine = ThisDrawing.ModelSpace.AddMLine(pts)oMLine.MLineScale = beamWidoMLine.Updatehstep = (frameWid - (beamWid * vnum)) / (vnum - 1)vstep = (frameHgt - (beamWid * hnum)) / (hnum - 1)Do While cnt < vnum - 1Set cMline = oMLine.CopycMline.MLineScale = beamWidcMline.Updatemovept(0) = varpt(0) + (cnt + 1) * (hstep + beamWid)movept(1) = varpt(1)movept(2) = 0#cMline.Move varpt, moveptcnt = cnt + 1LoopEnd Sub
~'J'~ |