Jump to content
Developer Wiki and Function Reference Links ×

Try to change texture of one of my created object


Robert - Bair

Recommended Posts

Hello everyone,

I am currently a student and as part of my training we have courses on Vectorworks. I'm trying to improve and I'm currently testing puppets. 

 

I'd like to quickly summarise my idea, I'd like to carry out a simple little project to choose from a set of furniture that I create in 3D and then convert into an object. I didn't have any problems creating the popup menu (which I'll probably change later to a drop-down menu in the OIP) but when I try to give it a texture it's impossible. I've also noticed that it's not possible to change the texture from the OIP when I drag and drop the object from the resource. 

 

I've tried using the info records or just duplicating the geometry, but without much success. Does anyone have a clue or an idea how to solve my problem ? 

 

Thanks in advance.

 

image.thumb.png.d6f04eabcbeafb68eaa401d62e33acf5.png

Link to comment

Hi Robert,

 

you really picked the big package right from the start 😄. I’ll try not to digress too much.

First, regarding your script:

The output of your “Get Symbol from Folder” nodes is a string. Let’s call it “Name” for better understanding.

If we briefly go through your script, the following happens:

All names of the objects are put into a list. Then this list is output in a popup dialog (later dropdown).

Now a texture is applied to these names. Finally, symbols are inserted into the drawing based on the names.

I think it’s clear that this can’t work. Theoretically, you would only need to put the output of your popup into the Symbol node first and then the output from the Symbol node into the Apply-Texture.

 

BUT

 

Now we come to the general part:

A symbol is a kind of group. As you have already noticed, a texture cannot be applied to a symbol, group, or 2D object. A symbol, of course, has many other great properties. Among other things, it can be hybrid. This means that as soon as a symbol consists of 2D and 3D objects, only the 2D objects are displayed in the 2D view and all 3D objects in a 3D view.

Now we come back to your dilemma. You can’t easily change the texture of your objects within your symbol. To do this, you first have to get to these objects.

Without complications, you usually only get hold of the symbol.

 

Solution approach:

Attached you will find a test file. To find the objects, we create a database. This must contain one row. It doesn’t matter what it is.

It is not used. Now you go into your symbols and activate the objects that should get a texture and link the database via the OIP.

Now we need an “Objs by Crit” node. With this, we can get all objects that have a specific database.

01.png.b95e692212331363080f0093995d6733.png

By the way: from the “Get Texture” node, you only need the text output. But a string where you enter the texture name is also sufficient.

For the “Objs by Crit” node, it is important to check the box for Symbol.

02.png.dc6b374c128b699e2090ed34654a8989.png

 

For your purposes, you now need to adjust and re-link your database.

This is just the tip of the iceberg. You could now enter multiple databases or multiple values into the database so that you can further subdivide the various objects. Depending on how complex and performant it needs to be.

To clarify, the “Objs by Crit” only checks objects in the drawing. So on construction or layout levels (depending on the checkbox).

No objects in the resource manager are considered. For that, you would need to dive a bit deeper 😄.

I work with german Vectorworks 2023.

 

Have fun and best regards

 

texturONsymbol.vwx

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...