Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 6023

How do store object text as a variable with rhino python?

$
0
0

@180mph wrote:

Hello,

I am new here and new to python as well. Sorry in advance if this has been discussed or if my question doesn't belong here.

The fun part:
I have been tasked with creating a script that takes part information from Rhino (length and area of each part by layer) to export to excel to create a database of part information. This will be used further in several calculators.

I have been making progress writing snippets to achieve those goals and now Im moving on to the actual exporting to CSV process of the script. All of our part numbers appear on our "design template" according to the name of the filename (using %< filename(3") >%) under the object properties.

So basically, I want the user to select an object, and then have the actual text of that object stored as a string inside a variable. It will only be one object that is selected.

currently this is the closest to the solution I have found:

filename = rs.GetObject()
print rs.GetUserText(filename)

When debugging I see that there is a text value stored inside "Rhino.Docbjects.TextObjects.DisplayText" but I have no clue on how to access that part of it.

Hints, Help, or Suggestions would be greatly appreciated!

Posts: 5

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 6023

Trending Articles