DriveWorks Pro 15: How To: Drive the Texture of a Part (KB13103010) [send feedback...]

Introduction

DriveWorks Pro provides the ability to drive a model's texture. To do this, create and capture a custom property in the model called "DWTexture", for more information have a look at the Custom Properties help topic.

The result of the rule for the DWTexture custom property should take the form:

PathToTextureBitmap|ScalePercentage|AngleInDegrees

For example:

"\\Data\Textures\Plastic.jpg|80|90"

Will result in the Plastic texture, which is located on the network, being applied at a scale of 80% and a rotation of 90 degrees.

ScalePercentage

The "Driven Scale" is the actual value sent to the model (multiplying factor, not percentage) and "Scale Percentage" is the value calculated and written in the rule.

We can define DrivenScale as 100 / ScalePercentage.

To calculate the value required in your rule: ScalePercentage = 100 / DrivenScale.

Examples

If you require 400% scaling this is the same as having a DrivenScale of 4. Therefore, ScalePercentage = 25 (100 / 4).

If you require the final size to be 50% of the original, ScalePercentage = 200 (100 / 0.5).

SOLIDWORKS textures are ordinarily installed a folder inside the SOLIDWORKS install directory called "SOLIDWORKS\data\Images\textures"

e.g.

C:\Program Files\SOLIDWORKS 2009\SOLIDWORKS\data\Images\textures

Because the SOLIDWORKS installation directory can be different on different machines, SOLIDWORKS provides a location-independent way to refer to the textures folder, e.g.:

"<SystemTexture>\images\textures\wall\rustic.jpg|80|90"

Will result in the standard SOLIDWORKS Rustic Brick texture being applied at a scale of 80% and a rotation of 90 degrees.

Apply a Texture to the Master

There must be a texture applied to the captured master part in order for DriveWorks to swap this out for the driven texture.


Knowledge Base Article Ref:KB13103010

Table of Contents