ZWSOFT User Community > ZWSOFT Forums - Find. Share. Connect. > ZWCAD > Zwcad+ VBA drawing line problem
Zwcad+ VBA drawing line problem
07-09-2012 02:19 . pm | View his/her posts only
I am trying to draw a simple line with VBA code.
Code is very simple and it works under Zwcad2011.
But it dosn't work uder Zwcad+2012.
I try this Zwcad+ ver.num=2012.08.30(5622) and Windows7-64bit.
Zwcad+ doesn't recognize "ZwcadLine". What should I write for that.
Sub drawline()
Dim lineObj As ZwcadLine
Dim startpoint(0 To 2) As Double
Dim endpoint(0 To 2) As Double
startpoint(0) = 0
startpoint(1) = 0
startpoint(2) = 0
endpoint(0) = 10
endpoint(1) = 5
endpoint(2) = 0
Set lineObj = ThisDocument.ModelSpace.AddLine(startpoint, endpoint)
End Sub
Thanks,
Code is very simple and it works under Zwcad2011.
But it dosn't work uder Zwcad+2012.
I try this Zwcad+ ver.num=2012.08.30(5622) and Windows7-64bit.
Zwcad+ doesn't recognize "ZwcadLine". What should I write for that.
Sub drawline()
Dim lineObj As ZwcadLine
Dim startpoint(0 To 2) As Double
Dim endpoint(0 To 2) As Double
startpoint(0) = 0
startpoint(1) = 0
startpoint(2) = 0
endpoint(0) = 10
endpoint(1) = 5
endpoint(2) = 0
Set lineObj = ThisDocument.ModelSpace.AddLine(startpoint, endpoint)
End Sub
Thanks,
Zwcad+ VBA drawing line problem
07-09-2012 04:36 . pm | View his/her posts only
Change code a little.
....
Dim lineObj As ZcadLine
....
Set lineObj = ThisDrawing.ModelSpace.AddLine(startpoint, endpoint)
....
....
Dim lineObj As ZcadLine
....
Set lineObj = ThisDrawing.ModelSpace.AddLine(startpoint, endpoint)
....
Zwcad+ VBA drawing line problem
07-09-2012 06:01 . pm | View his/her posts only
Yes, you are right.
Is your code works now?
Is your code works now?
Zwcad+ VBA drawing line problem
07-09-2012 08:30 . pm | View his/her posts only
Yes.
I successfully ported my VBA code from AutoCAD to ZWCAD+ simply by changing "Acad" substrings to "Zcad" and several "ac" entries to "zc" (for example, zcActiveViewport, zcWorld, zcDisplayDCS, etc.)
Thanks,
I successfully ported my VBA code from AutoCAD to ZWCAD+ simply by changing "Acad" substrings to "Zcad" and several "ac" entries to "zc" (for example, zcActiveViewport, zcWorld, zcDisplayDCS, etc.)
Thanks,
Zwcad+ VBA drawing line problem
08-09-2012 08:45 . am | View his/her posts only
Good to hear that, and you're welcome
Zwcad+ VBA drawing line problem
09-09-2012 10:23 . pm | View his/her posts only
Yes, code is working now.
Thanks.
Thanks.




