View Full Version : Macroing a Line

04 April 2004, 09:13 PM
As part of a script i want the user to click a button which creates a custom shape (a car icon) However when i draw the shape and copy the code from the listener the shape is not replicated from the code shown in the listener.
Can someone tell me the syntax for a line eg how i can specify points and so forth.
thanks in advance :)

04 April 2004, 08:27 AM
-- create a new shape
ss = SplineShape()
-- add a new spline to the shape
addNewSpline ss
-- create some knots
addKnot ss 1 #corner #line [0, 0, 0]
addKnot ss 1 #corner #line [100, 0, 0]
addKnot ss 1 #corner #line [100, 100, 0]
addKnot ss 1 #corner #line [0, 100, 0]
-- close the spline (connects last with first knot)
close ss 1
-- updates internal cache and vp display
updateShape ss

This is just a basic example on how to draw shapes. See the online reference for more help on the individual statements.

- Martijn

04 April 2004, 10:05 PM
thanks magicm :) just what i was after

CGTalk Moderation
01 January 2006, 01:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.