PDA

View Full Version : VBscript Question


foxco
08-22-2004, 07:48 PM
Hey all, i cant show the script here so youll have to make do with my explaination

when Run you pick a curve or it uses the selected curve and does a variety of tasks, and im at a point where i need the script to count and return the number of points on the curve to be used in a "for" loop. ive been searching though the database in sdk help for a while now and i cannot find out how to acomplish this. the lack and non exsistance of tutorials for xsi scripting is frustrating but the sdk help has been pretty good so far. so ya thanks in advance and if anyone knows where to get a good basics tutorial for XSI VB it would be great

/fox

foxco
08-26-2004, 08:59 PM
Hey Sorry but i realy do need some help here, i still cant figure it out :bounce: ?

ThE_JacO
08-26-2004, 10:11 PM
select a curve and run this:


set oSelection = Selection(0)

set oNurbsCurveList = oSelection.ActivePrimitive.Geometry
set oNurbsCurves = oNurbsCurveList.Curves
for each oFace in oNurbsCurves
logmessage "number of knots = " & oFace.knots.count
next

remember that nurbs always have 2 ghost points hidden somewhere before the start and after the end (to parametrize the ends), so if you want only the count of the visualized points you want to subtract 2 to that count.

if you want to walk the points for any reason then you need to walk the ghost points.

Atyss
08-27-2004, 07:26 PM
XSI Experience 4 has a very nice and easy chapter about scripting. You should really have a look at it.


Cheers
Bernard

foxco
08-27-2004, 10:46 PM
thanks to both, oface.knots was the key, i coulnt figure out what the collection was, i kept trying points or controlvertices or cv. i just never saw .knot used in a collection example so i didnt know it was there, i shall have a look at that book then,

cheers
fox

ThE_JacO
08-28-2004, 12:37 AM
thanks to both, oface.knots was the key, i coulnt figure out what the collection was, i kept trying points or controlvertices or cv. i just never saw .knot used in a collection example so i didnt know it was there, i shall have a look at that book then,

cheers
fox
you should put some more efforts into reading the docs and understand how they are structured then.
I checked and it's fairly easy to get there from just typing curve in the search or browsing down the object model, plus one of the examples was exactly on getting the knots (not the count tho but that's just one more property to add).

CGTalk Moderation
01-19-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.