Vector Drawing
Vector Drawing
(OP)
Now here is the problem
The inputs are the length of beams
as the lengths are entered i want to show a solid line corresponding the beam.
the second input is the location of load on the beam.
Now i want a vert line representing load to be dispalyed over the previos solid line. let suppose the first beam(hor.) was of 10 ft now the loads are at 3 ft from right.
i just want to kno which topic i should scroll for this and if i can get hints onthis it would be great.
thanx
The inputs are the length of beams
as the lengths are entered i want to show a solid line corresponding the beam.
the second input is the location of load on the beam.
Now i want a vert line representing load to be dispalyed over the previos solid line. let suppose the first beam(hor.) was of 10 ft now the loads are at 3 ft from right.
i just want to kno which topic i should scroll for this and if i can get hints onthis it would be great.
thanx





RE: Vector Drawing
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: Vector Drawing
Set lineObj = ThisDrawing.ModelSpace.AddLine(pt1, pt2)
How much do you have programmed so far? Can you connect to AutoCAD? Open an existing drawing or start a new drawing? Do you have a front end to get the user's inputs?
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: Vector Drawing
Is it true that every time i call a new autocad drawing to start the whole auotoCAD software is launched with it, as it can slow the procedure a lot.
I have an EXE file of such a programme made on VB with me is there a way to DECODE it?
RE: Vector Drawing
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: Vector Drawing
AutoCad 2000
RE: Vector Drawing
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: Vector Drawing
either tell me or guide me to the source plz
RE: Vector Drawing
Option Explicit
Private Sub cmdCancel_Click()
Unload Me
End
End Sub
Private Sub cmdOK_Click()
Dim rLen As Double, rHgt As Double
Dim CadApp As AcadApplication
Dim CadDwg As AcadDocument
Dim lineObj As AcadLine
Dim textObj As AcadText
Dim pt1(0 To 2) As Double, pt2(0 To 2) As Double, pt3(0 To 2) As Double
Dim pt4(0 To 2) As Double, pt5(0 To 2) As Double
Dim x As Integer, y As Integer, z As Integer
x = 0
y = 1
z = 2
'Get the textbox values
If IsNumeric(txtLength.Text) = True Then
rLen = CDbl(txtLength.Text)
Else
MsgBox "Invalid Length"
Exit Sub
End If
If IsNumeric(txtHeight.Text) = True Then
rHgt = CDbl(txtHeight.Text)
Else
MsgBox "Invalid Height"
Exit Sub
End If
'<><><><><><><><><><><><><><><><><><><><><>
' Connect to AutoCAD
'<><><><><><><><><><><><><><><><><><><><><>
On Error Resume Next
TryAgain:
Set CadApp = GetObject(, "AutoCAD.Application")
If Err.Number <> 0 Then 'Not Running
Set CadApp = CreateObject("AutoCAD.Application")
Err.Clear
'AutoCAD may open a new drawing upon opening - close it
CadApp.ActiveDocument.Close False
If Err.Number <> 0 Then
Err.Clear 'No Drawings are Open
End If
End If
On Error GoTo 0
'Add a new drawing
CadApp.Documents.Add
Set CadDwg = CadApp.ActiveDocument
'Define the points - start at 0,0
pt1(x) = 0#: pt1(y) = 0#: pt1(z) = 0#
pt2(x) = pt1(x) + rLen
pt2(y) = pt1(y)
pt2(z) = 0#
pt3(x) = pt2(x)
pt3(y) = pt2(y) + rHgt
pt3(z) = 0#
pt4(x) = pt1(x)
pt4(y) = pt3(y)
pt4(z) = 0#
'Draw the lines
Set lineObj = CadDwg.ModelSpace.AddLine(pt1, pt2)
Set lineObj = CadDwg.ModelSpace.AddLine(pt2, pt3)
Set lineObj = CadDwg.ModelSpace.AddLine(pt3, pt4)
Set lineObj = CadDwg.ModelSpace.AddLine(pt4, pt1)
'Add some text
pt5(x) = (pt1(x) + pt2(x)) / 2
pt5(y) = (pt1(y) + pt4(y)) / 2
pt5(z) = 0#
Set textObj = CadDwg.ModelSpace.AddText("HERE YOU GO!", pt5, 0.125)
CadApp.ZoomExtents
Set lineObj = Nothing
Set CadDwg = Nothing
Set CadApp = Nothing
Unload Me
End
End Sub
This sample will create a new drawing. Instead of CadApp.Documents.Add, use the CadApp.Documents.Open command to open an existing drawing. Then, the
Set CadDwg = CadApp.ActiveDocument
command will attach to the active drawing. From there, you can do whatever you need.
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.