PDA

View Full Version : changepart



zyhsu
08-15-2003, 12:05 AM
Hi!

I want to write a script to transfer all object surface into part,so I wrote like this:

workLayer = lyrfg();

surf = nextsurface();
selpolygon(SET, SURFACE, surf);
changepart(surf);

all I get is a message "unresolved function changepart()", but it work fine if I use changesurface instead, can someone tell me what is wrong?

Thanks!!

Tom Speed
08-15-2003, 10:53 PM
Hi,

You have to be in USER mode before you can select Polygons/Points. maybe that's the problem.


This works, it assigns Polys to a Part tag whose name is the same as the surface they belong to:



@version 2.6
@warnings
@name Surf_2_Parts


main
{
selpolygon(CLEAR);
selmode(USER); // so we can select polys

surf = nextsurface(); // get first surface
while(surf) // while we have a surface..
{
selpolygon(SET,SURFACE,surf); // select this surfaces polys
changepart(surf); // assign these polys to a Part of the same name as the surface
selpolygon(CLEAR);
surf = nextsurface(surf); // next surface
}
}


Tom

evenflcw
08-16-2003, 12:34 AM
If that's not it, maybe you're just using an outdated version of lscript, seeing as changepart() only got added in the very last update.

zyhsu
08-17-2003, 08:41 PM
[email protected]:
Thanks! I willlook into this!
Sincerely Yours
Ze-Yi Hsu