CAD/CAM discussion forum > CAD > open ZWCAD from Excel

open ZWCAD from Excel

    
  Subscribe Topic

Rank: 1

OldForumPost

Newbie

posts: 0

Registered: 2012-1-14

Message 1 of 5

 open ZWCAD from Excel
01-01-1970 08:00 . am   |   View his/her posts only
Hi,

I would like to be able to build a drawing in ZWCAD from Excel VBA. That would include the following steps:

1. Open ZWCAD if it is not already open
2. draw a line, polyline
3. draw solids (cube, sphere etc.)
4. save the drawing
5. export the content as SAT
6. close the application

Any suggestions, examples?

Thank you

Katto01

Rank: 1

Stas

Newbie

posts: 0

Registered: 2012-1-12

Message 2 of 5

11-01-2012 10:46 . am   |   View his/her posts only
You neeed use COM object
Please look at this code fragment

Sub open_dwg()
Dim ZwCAD As ZwcadApplication
Dim frame As ZwcadDocument
Dim frameMSpace As ZwcadModelSpace

'create ZWCad Application
Set ZwCAD = CreateObject("ZwCAD.Application")
'open dwg-document
Set frame = ZwcadApplication.Documents.Open("'lib'frame.dwg")
'set model variable
Set frameMSpace = frame.ModelSpace;
'............
'
'insert here your function and code for adding object
'look at help for ModelSpace and adding objects
'
'............
End Sub

Rank: 1

DDWZW

Newbie

posts: 142

Registered: 2011-11-23

Message 3 of 5

05-03-2012 03:33 . pm   |   View his/her posts only
does it help?

Rank: 1

henlim

Newbie

posts: 1

Registered: 2011-12-10

Message 4 of 5

17-03-2012 12:24 . pm   |   View his/her posts only
i want to study it ,, how I get it ?,, Thanks

Rank: 1

DDWZW

Newbie

posts: 142

Registered: 2011-11-23

Message 5 of 5

23-03-2012 11:03 . am   |   View his/her posts only
Reply 4# henlim


I want to learn how to
See also
X