Taking content from arrays to open a .3ds file
-
This is part of my program. what it is intented to do is get the first line of a txt file which is saved in a[0]. this will be the name of a .3ds model which than has to be imported in sketchup, but to do so, .3ds has to be added to the name. Something is wrong with my code I know it's something in the first line shown but I can't figure how to write it
correctly.machine = "a[0].3ds"
model = Sketchup.active_model
show_summary = true
status = model.import machine, show_summaryThanks
-
Your
machine = "a[0].3ds"
Is simply a string - with no reference to array 'a' at all.
machine = a[0].to_s+".3ds"
Takes the value of the first item in the array 'a' and adds .3ds onto the end of that all as a string...
If you are sure the first item in the array 'a' is a string you don't need the .to_s parta[0]+".3ds"will do...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement