Jump to content
Developer Wiki and Function Reference Links Read more... ×
Carles Olle

How to get a Texture Reference ID from Texture Name

Recommended Posts

I'm sure this a silly question but I'm just new to VW Scripting.

I need to create an Image Prop in marionette. One of the parameters is the "texture" that will be used. Looking at the node definition script, this is supposed to be a Texture Reference ID.

I got the texture name but that does not seem to work as a input parameter for the "Image Prop" node; How to get a Texture Reference ID from Texture Name

Help will be appreciated.



Share this post

Link to post



I haven't done this myself, but afaik a Texture - much like a Line Type or Hatch - will be referenced by an Index number rather than its name - Just to make things more complicated ;)




Finding out the index value of your - I guess custom - texture will probably be a bit difficult.

Dig through the VS function reference and you might find a way to get the texture from a referenced object/class.



Personally, I've resorted to creating a Class for every "look" I want and just assign my objects to them accordingly.


Share this post

Link to post

Hi, have a look at the end of this script as to how you get the texture.

And its not a silly question, should have seen the dumb questions I asked at the beginning.
Also if you need to create an image prop the node is under Objects / Solid.



Edited by Alan Woodwell

Share this post

Link to post

Hi, me again, I couldn't get this to work until I used my custom node Name2Index which converts a texture name to the code. It is used to get slab Index and it works here also.HTH
Will need to sort out the transparency, maybe will have to code up a node or maybe set up an image with transparency alpha channel.
Will investigate.




Edited by Alan Woodwell

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.