Forgot password?

Create an account!


« back

General – Totally brand new to scripting.


Please log in to write a message.

  • 3. Chubbyranks (Apr 11, 2011 14.22):

    thank you hanno for your input, definately helpfully, being new to this i think littler pointers go a long way

  • 2. Hanno (Apr 11, 2011 11.20):


    the problem is that you are mixing up object names and IDs.
    All your typical strObject parameters refer to object IDs, which are unique for any object and cannot be changed. Thus these IDs are used to represent Rhin objects in scripting.
    Object Names can be any string - they can be changed and there can be several objects with the same name.
    Have a look at Rhino.ObjectsByName. This returns the object IDs of all objects with a certain name, or NULL if the name is not in use.

    Hope that helps!


  • 1. Chubbyranks (Apr 11, 2011 08.45):

    I am totally new to scripting (two days now) and am trying to self teach (not easy) i have probably a very simple question, if you know the answer,

    I want to write a very besic script that checks for the existance of an object (by object name) in a current .3dm file and if it finds one changes the search name by one increment and seaches again until it doesnt find one.

    Example: i have already created 100 boxes and their names start with BOX... and then a number to give it a unique identity, now i want to create BOX 101 but am unsure if this ID is already existing so i want the script to start at box 0 and keep checking and increasing value by 1 untill it finds an ID that doesn't exist.

    I am playing about with Rhino.IsObject(strobject) first just to see if i can get the comannd to recognise just one object but it cant, can any one advise as to where i am going wrong. Does the Rhino.IsObject command require for an object to be selected and if so is there a command that doesn't require this?

    Much confused


Why are these buttons gray?