EverZen
10-24-2007, 11:59 AM
Hi all
I am writing a simple plugin that extends the Point helper (see below). The instance of the plugin is going to be created from another script. When an instance of this plugin is created I want it to grab some data from a currently selected object and then position the instance relative to this object. To do this I used the
on create do ()
Event handler. I am using the "this" local variable to set some of the instance parameters (LouvrePos, LouvreDir, LouvreWith, LouvreHeight), which works fine. But if I try and use "this" to access the position or name, I am getting "unknown property" errors. See below :)
plugin helper LouvreControl
name:"LouvreControl"
classID:#(0x727e101b, 0xbf75d18)
extends:Point
replaceUI:true
invisible:true
(
.........
on postcreate do
(
--look at first spline in selection
RefSpline = for o in selection collect o
RefSpline = RefSpline[1]
--Function to extract an array of information from the spline
LouvreStats = ApertureSplinePositioningData RefSpline
--This all works fine
this.LouvrePos = LouvreStats[1]
this.LouvreDir = LouvreStats[2]
this.LouvreWith = LouvreStats[3]
this.LouvreHeight = LouvreStats[4]
--These next lines kick up errors! saying unknown property
this.pos = RefSpline.pos
)
)
Error: Unknown Property pos in LouvreControl
Is there anyway to access name or position (and other) propertes, so I can position etc the instance of the pluggin correctly? Even if I could select it, it woudl do, but "select this" returns an error too.
I am getting the feeling I am doing something very basic wrong, if someone could shed some light on the situation I would be very grateful indeed!
Thanks for your time guys...
Rich
I am writing a simple plugin that extends the Point helper (see below). The instance of the plugin is going to be created from another script. When an instance of this plugin is created I want it to grab some data from a currently selected object and then position the instance relative to this object. To do this I used the
on create do ()
Event handler. I am using the "this" local variable to set some of the instance parameters (LouvrePos, LouvreDir, LouvreWith, LouvreHeight), which works fine. But if I try and use "this" to access the position or name, I am getting "unknown property" errors. See below :)
plugin helper LouvreControl
name:"LouvreControl"
classID:#(0x727e101b, 0xbf75d18)
extends:Point
replaceUI:true
invisible:true
(
.........
on postcreate do
(
--look at first spline in selection
RefSpline = for o in selection collect o
RefSpline = RefSpline[1]
--Function to extract an array of information from the spline
LouvreStats = ApertureSplinePositioningData RefSpline
--This all works fine
this.LouvrePos = LouvreStats[1]
this.LouvreDir = LouvreStats[2]
this.LouvreWith = LouvreStats[3]
this.LouvreHeight = LouvreStats[4]
--These next lines kick up errors! saying unknown property
this.pos = RefSpline.pos
)
)
Error: Unknown Property pos in LouvreControl
Is there anyway to access name or position (and other) propertes, so I can position etc the instance of the pluggin correctly? Even if I could select it, it woudl do, but "select this" returns an error too.
I am getting the feeling I am doing something very basic wrong, if someone could shed some light on the situation I would be very grateful indeed!
Thanks for your time guys...
Rich
