[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [femm] Selectgroup problem



Hello David.
Thank you very much. My problem is solved.Since I now also understand what I did wrong I even could make my program, that build scripts, better then it was before.
Best regards,
Eric Vogels.
 
----- Original Message -----
Sent: Saturday, May 24, 2003 3:53 PM
Subject: Re: [femm] Selectgroup problem

The last segment in the square never gets assigned to group 3.   If you change the line:
selectsegment(x1,y1)
in function setsegment(x1, y1, x2, y2, group) to:
selectsegment((x1+x2)/2,(y1+y2)/2)
it ought to work ok.  The way that you had it, there was ambiguity as to which segment actually got selected.

Dave.


Eric Vogels wrote:
Hello.
 
I made a lua-script but I have a problem with it. I stripped all the code that works fine and only have the problem left.
 
-- ---------------------------------------------------------Start code
-- function to add nodes to group x
function setnode(x, y, group)
   addnode(x,y)
   selectnode(x,y)
   setnodeprop("<none>",group)
   clearselected()
end
 
-- function to add segement to group x
function setsegment(x1, y1, x2, y2, group)
   addsegment(x1,y1,x2,y2)
   selectsegment(x1,y1)
   setsegmentprop("<none>",1,1,0,group)
   clearselected()
end
 
-- Stators
setnode(8,4,3)
setnode(8,3,3)
setnode(9,3,3)
setnode(9,4,3)
setsegment(8,3,8,4,3)
setsegment(9,4,8,4,3)
setsegment(9,3,9,4,3)
setsegment(8,3,9,3,3)
 
selectgroup (3)
copyrotate(4.076,4.076,45,7)
-- ---------------------------------------------------------End code
 
The problem is that the last 'setsegment(- statement does not set the groupnr 3 but all other statements work fine. The copyrotate is missing a segment while copying because of that. Does someone see what I did wrong? I tried a lot of changes and I'm running out of fantasy. Please help.
Best regards,
Eric.


-- 
David Meeker
dmeeker@xxxxxxxx
http://femm.berlios.de/dmeeker


Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.