hey.. i have a question regarding t
hey.. i have a question regarding t
(OP)
hey.. i have a question regarding the code below..
i can draw the line in ACAD_ISO02W100...??
can someone correct for me??
Set acadApp = GetObject(, "autoCAD.application")
Set acadDoc = acadApp.activedocument
Set modelspace = acadDoc.modelspace
Dim PLine2Obj As Object
Dim Points2(0 To 14) As Double
EWNS = -315
Points2(0) = -513.8151: Points2(1) = 10 + EWNS: Points2(2) = 0
Points2(3) = -493.8151: Points2(4) = 10 + EWNS: Points2(5) = 0
Points2(6) = -493.8151: Points2(7) = 100 + EWNS: Points2(8) = 0
Points2(9) = -513.8151: Points2(10) = 100 + EWNS: Points2(11) = 0
Points2(12) = -513.8151: Points2(13) = 10 + EWNS: Points2(14) = 0
Set PLine2Obj = modelspace.AddPolyline(Points2)
modelspace.Linetypes.Load "ACAD_ISO02W100", "acad.lin"
PLine2Obj.Linetype = "ACAD_ISO02W100"
i can draw the line in ACAD_ISO02W100...??
can someone correct for me??
Set acadApp = GetObject(, "autoCAD.application")
Set acadDoc = acadApp.activedocument
Set modelspace = acadDoc.modelspace
Dim PLine2Obj As Object
Dim Points2(0 To 14) As Double
EWNS = -315
Points2(0) = -513.8151: Points2(1) = 10 + EWNS: Points2(2) = 0
Points2(3) = -493.8151: Points2(4) = 10 + EWNS: Points2(5) = 0
Points2(6) = -493.8151: Points2(7) = 100 + EWNS: Points2(8) = 0
Points2(9) = -513.8151: Points2(10) = 100 + EWNS: Points2(11) = 0
Points2(12) = -513.8151: Points2(13) = 10 + EWNS: Points2(14) = 0
Set PLine2Obj = modelspace.AddPolyline(Points2)
modelspace.Linetypes.Load "ACAD_ISO02W100", "acad.lin"
PLine2Obj.Linetype = "ACAD_ISO02W100"





RE: hey.. i have a question regarding t
You should also declare the plineObj as a polyline:
Dim PLine2Obj As AcadPolyline
Set cadApp = GetObject(, "AutoCAD.Application")
Set cadDoc = cadApp.ActiveDocument
Dim PLine2Obj As AcadPolyline
Dim Points2(0 To 14) As Double
EWNS = -315
Points2(0)=-513.8151:Points2(1)=10+EWNS:Points2(2)=0
Points2(3)=-493.8151:Points2(4)=10+EWNS:Points2(5)=0
Points2(6)=-493.8151:Points2(7)=100+EWNS:Points2(8)=0
Points2(9)=-513.8151:Points2(10)=100+EWNS:Points2(11)=0
Points2(12)=-513.8151:Points2(13)=10+EWNS:Points2(14)=0
Set PLine2Obj = cadDwg.ModelSpace.AddPolyline(Points2)
cadDwg.ModelSpace.Linetypes.Load "ACAD_ISO02W100", "acad.lin"
PLine2Obj.Linetype = "ACAD_ISO02W100"
ΓΏ
Hope this helps!
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: hey.. i have a question regarding t
i tried to use the same code in visual basic.. but it doesn't work.... it can't load the linetype...:(
besides,, what about the ZoomALL command?? coz i doesn't define in visual basic..
RE: hey.. i have a question regarding t
I started a new VB application that contained a single form. I put a command button on that form and put this code behind it.
Option Explicit
Dim cadApp As AcadApplication
Dim cadDoc As AcadDocument
Private Sub Command1_Click()
Dim EWNS As Integer
Set cadApp = GetObject(, "AutoCAD.Application")
Set cadDoc = cadApp.ActiveDocument
Dim PLine2Obj As AcadPolyline
Dim Points2(0 To 14) As Double
EWNS = -315
Points2(0)=-513.8151:Points2(1)=10+EWNS:Points2(2)=0
Points2(3)=-493.8151:Points2(4)=10+EWNS:Points2(5)=0
Points2(6)=-493.8151:Points2(7)=100+EWNS:Points2(8)=0
Points2(9)=-513.8151:Points2(10)=100+EWNS:Points2(11)=0
Points2(12)=-513.8151:Points2(13)=10+EWNS:Points2(14)=0
Set PLine2Obj = cadDoc.ModelSpace.AddPolyline(Points2)
cadDoc.Linetypes.Load "ACAD_ISO02W100", "acad.lin"
PLine2Obj.Linetype = "ACAD_ISO02W100"
cadApp.ZoomAll
Unload Me
End
End Sub
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: hey.. i have a question regarding t
cadApp As AcadApplication.... coz undefined on the statement....??
besides, how to i add the AutoCAD Object Library to my project references??
sorry to ask so many questions to you...:(
RE: hey.. i have a question regarding t
If you are using VBA, in, let's say Excel, go to Tools > References and do the same thing.
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: hey.. i have a question regarding t
thanz you so much..:)!!