VBA, can you with code editor show a 3d solid ?

#1
Hi there,
In my opinion this IntelliCAD never let me down - I can easily draw this by manual.
Feel free comment my program because 3d shapes are not showing and yes I prefer builtin editor.

JB

Code: Select all

    Dim myDoc As IntelliCAD.Document
    Dim pt As IntelliCAD.Point
    Dim t As IntelliCAD.Text
    Dim s As IntelliCAD.Solid3D
    Dim c As Integer
    
    Set myDoc = ActiveDocument
    Set pt = Library.CreatePoint(100, 200, 0)
        
    For i = 1 To 10
        pt.y = pt.y + 125
        Set t = myDoc.ModelSpace.AddText("Hello World!", pt, 100)
        t.color.SetRGB i * 10, i * 15, i * 20
        pt.x = pt.x - 100
        
        ' How to show box?
                
        Set s = myDoc.ModelSpace.AddBox(pt, 100, 100, 100)
        s.color.SetRGB i * 10, i * 15, i * 20
        pt.x = pt.x + 100
        
    Next i
    
    ' How to clear drawing?
    ' How to show all of drawing?
    ' How to change perspective and view?
    ' How to close form?
    
Last edited by JB37 on Sun Jun 07, 2020 1:23 pm, edited 1 time in total.

Re: VBA, can you with code editor show a 3d solid ?

#2
Hi JB,
Maybe you need to zoom extent the drawing to see the objects.
Here's the result of your code.
Box.png
Box.png (30.33 KiB) Viewed 957 times

Code: Select all

Public Sub AddBoxEx()
    Dim myDoc As IntelliCAD.Document
    Dim pt As IntelliCAD.Point
    Dim t As IntelliCAD.text
    Dim s As IntelliCAD.Solid3D
    Dim c As Integer
    
    Set myDoc = ActiveDocument
    Set pt = Library.CreatePoint(100, 200, 0)
        
    For i = 1 To 10
        pt.y = pt.y + 125
        Set t = myDoc.ModelSpace.AddText("Hello World!", pt, 100)
        t.color.SetRGB i * 10, i * 15, i * 20
        pt.x = pt.x - 100
        
        ' How to show box?
        Set s = myDoc.ModelSpace.AddBox(pt, 100, 100, 100)
        s.color.SetRGB i * 10, i * 15, i * 20
        pt.x = pt.x + 100
        
    Next i
    
    ' zoom
    IntelliCAD.ActiveDocument.Application.ZoomExtents
    
End Sub
cron