home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Houseplan Collection
/
HRCD2005.ISO
/
data1.cab
/
Zusatz
/
3DS
/
DATA2.Z
/
Dialog.frm
< prev
next >
Wrap
Text File
|
1999-04-30
|
4KB
|
117 lines
VERSION 5.00
Begin VB.Form Dialog
Caption = "Beispiel fⁿr eine Dach-Holzkonstruktion"
ClientHeight = 1875
ClientLeft = 60
ClientTop = 345
ClientWidth = 5640
LinkTopic = "Form1"
ScaleHeight = 1875
ScaleWidth = 5640
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton CreateRoof
Caption = "Dach erzeugen!"
Height = 555
Left = 1440
TabIndex = 0
Top = 1080
Width = 2655
End
Begin VB.Label Label1
Caption = $"Dialog.frx":0000
Height = 495
Left = 120
TabIndex = 1
Top = 120
Width = 5415
End
End
Attribute VB_Name = "Dialog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim prg As New ArCon.ArCon
Private Sub CreateRoof_Click()
' Makro mit ArCon verbinden
prg.StartMe hWnd, ""
' Testen, ob ein Projekt geladen ist
If prg.Mode = AC_NoMode Then
' Kein Projekt geladen, wir brauchen ein neues
prg.CreateProject prg.NewProject
End If
' In den Konstruktionsmodus schalten
prg.Mode = AC_ModeConstruct
' Neue Dachkonstruktion beginnen
Dim constr As ArCon.RoofConstruction
Set constr = prg.NewRoofConstruction
With constr
' erste DachflΣchen definieren
.BeginNewArea ACDACH_FlaecheEindeckung
.AddPoint 0, 0, 0
.AddPoint 10, 0, 0
.AddPoint 10, 4, 4
.AddPoint 0, 4, 4
' zweite DachflΣchen definieren
.BeginNewArea ACDACH_FlaecheEindeckung
.AddPoint 10, 8, 0
.AddPoint 0, 8, 0
.AddPoint 0, 4, 4
.AddPoint 10, 4, 4
' Balken erzeugen
Dim i As Integer, dx As Double
Const PI As Double = 3.1415926
Const TexDirX As Double = 0
Const TexDirY As Double = 45 * PI / 180
Const TexDirZ As Double = 90 * PI / 180
Const dBreite As Double = 0.08
Const dDicke As Double = 0.16
Const dAbstand As Double = 0.8
dx = 0
For i = 1 To 10
' Neuer Sparren (der Name ist optional)
.NewRafter ACRWOOD_Sparren, "Sparren", dBreite, dDicke
' Ausrichtung festlegen
.RafterSetGeo ACRAFTER_TextureDir, TexDirX, TexDirY, TexDirZ
' Erster Eckpunkt
.RafterSetGeo ACRAFTER_Left1, dx + 0.2, 0, 0
.RafterSetGeo ACRAFTER_Right1, dx + 0.28, 0, 0
' Zweiter Eckpunkt
.RafterSetGeo ACRAFTER_Left1, dx + 0.2, 4, 4
.RafterSetGeo ACRAFTER_Right1, dx + 0.28, 4, 4
' Dritter Eckpunkt
.RafterSetGeo ACRAFTER_Left1, dx + 0.2, 4, 4 - 0.16 / 0.707
.RafterSetGeo ACRAFTER_Right1, dx + 0.28, 4, 4 - 0.16 / 0.707
' Vierter Eckpunkt
.RafterSetGeo ACRAFTER_Left1, dx + 0.2, 0, 0 - 0.16 / 0.707
.RafterSetGeo ACRAFTER_Right1, dx + 0.28, 0, 0 - 0.16 / 0.707
dx = dx + dAbstand
Next
' Analyse der Geometrie durchfⁿhren (ohne automatische Unterfⁿllung)
.Analyze False
' Alles klar?
If .Fehler <> "" Then
MsgBox .Fehler
Else
' Die Konstruktion ist vollstΣndig - Dach erzeugen
.CreateRoof prg.CurrentStory
End If
End With
Set constr = Nothing
' Fertig, Makro Verbindung zu ArCon terminieren
prg.EndMe
End Sub