Programming
Programming
Abstract: The paper gives a short overview on the Canvas X Pro 16 integrated environment for vector
illustration, imaging, presentations, and Web publishing software together with the scripting technologies
that can be used to program the product. Some programming examples in VBScript and Visual Basic
about how to draw an extruded spur gear are covering most of the features that are useful for the
mechanical engineers work.
Key words: Canvas X Pro 16, programming, VBScript, Visual Basic, vector graphics.
When running this simple VBScript code of the CVArc object. When creating an arc the
Canvas X has a strange habit. Instead of width, height, starting point in degrees, and the
keeping the current environment configuration angular length of the arc must be given
(which is set from File > Configuration according to [6]. The code to create the first arc
Center) it opens the original one, where the (arc 1) from Figure 1 should normally be the
paper size is Letter and the units are set to following:
inches. Unfortunately, the object model has no
properties that can be used to set these values aly.CreateArc 90, 102, 4, 18, 270, 90
when creating a new document. Another bug
seems to be related to the CreateArc() method or
153
Fig. 3. The Start and Delta Angle bug with CreateArc() method of the CVArc object in VBScript.
’clear errors and make the ’select the teeth and the circle to
application visible combine the to a gear, at this stage
On Error GoTo 0 we have a solid gear with no hole
cv.Visible = True doc.Selection.SelectAll
doc.Selection.Combine
’opend a new illustration Canvas cvsOutlineCombine
document
Set doc = ’create another circle to make a
cv.Documents.Add(cvsIllustrationDocume hole in the gear
nt) aly.CreateOval 80, 150, 40, 40
’get the active layer to start the ’create a new gear by subtracting
model the circle from the gear
Set aly = doc.Selection.SelectAll
cv.ActiveDocument.ActivePage.ActiveLay doc.Selection.Combine
er cvsSubstituteFrontCombine
5. REFERENCES
Rezumat: Lucrarea oferă o scurtă privire de ansamblu asupra produsului software Canvas X Pro 16 pentru ilustrare
vectorială, imagistică, prezentări și editare Web, împreună cu tehnologiile de scripting care pot fi folosite pentru a
programa mediul. Câteva exemple de programare în limbajele VBScript și Visual Basic cu privire la modul de generare
a unei roţi dinţate cilindrice cu dinţi drepţi sunt date pentru a ilustra posibilităţile de utilizare în domeniul ingineriei
mecanice.