Message 1 of 6
error msg: attempt to access deleted nodes

Not applicable
04-02-2008
02:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This block of codes intents to create a object which describes the geometry informations of traffice symbol lines, including the width ,the length, the spacing between to short lines, make polygon copys of the lines,and keep the polygon copys(as an array) as a attribute so that I can access the type conveniently.
My first language is not English, apologize for my poor expression.
Anyway , codes talk:
then I run these codes:
then when I run this line: select a.polys
It says "attempt to access deleted nodes".
I prefer that when I change a's property and run a.makePolys() again ,it will CHANGE the Polys into a new version but not CREATE a new version of polys. But however, the "deleted Nodes" thing now is getting in my way.
Any help?
My first language is not English, apologize for my poor expression.
Anyway , codes talk:
struct trafficLine
(
name,
width = 0.15,
length,
spacing,
guideLines = #(),
Polys = #(),
fn makePolys =
(
if polys.count != 0 then for i in polys do delete i
polys = #()
tempPart = plane width:length length:width name:(uniqueName name) lengthsegs:1 widthSegs:1 mapcoords:on
for i in guideLines do
(
currentPoly = MakeStripPoly i tempPart spacing 0.5 off
--function "MakeStripPoly" will return a polygon object made by given parameters.
append polys currentPoly
)
),
fn resetGuidelines =
(
guideLines = #()
),
fn resetPolys =
(
polys = #()
),
fn nameGuideLines =
(
for i in guideLines do i.name = uniqueName (name + "_GuideLine")
)
)
then I run these codes:
a = trafficLine name:"haha" guideLines:(for i in selection where canConvertTo i splineshape collect i) width:0.15 length:2 spacing:4
a.width = 3
a.length = 5
a.spacing = 4
--a.setGuidelinesBySelection()
a.makePolys()
then when I run this line: select a.polys
It says "attempt to access deleted nodes".
I prefer that when I change a's property and run a.makePolys() again ,it will CHANGE the Polys into a new version but not CREATE a new version of polys. But however, the "deleted Nodes" thing now is getting in my way.
Any help?