API help for Setting Hatch pattern

Hi there,

I'm tweaking my Custom Property gizmo that I have been developing for what seems like years now and have run into a roadblock.

I'm trying to set the hatch pattern using the command

RetVal = Part.SetUserPreferenceStringValue(swMaterialPropertyCrosshatchPattern, hatch)

When I execute this I get a false in return in RetVal. This works in VBA, but not in VB. I've got everything else working, I can read and set density, but not the hatch pattern.

The odd part is when I attempt to read the existing hatch pattern, I get an empty result.

Is there a secret here or is this non-functional?

Oh, I'm using Swx 2003 SP3.1

Cheers,

Chris

Reply to
Chris Dubea
Loading thread data ...

Just a follow up. I got it to work. It doesn't like the word hatch used as a variable, and I had a space in the hatch name.

Thanks anyway,

CD

Reply to
Chris Dubea

Check that swMaterialPropertyCrosshatchPattern = 13,

I've used the following line without problems in 2001 through to 2003 sp4

retval = Part.SetUserPreferenceStringValue(13, matprops(Material.ListIndex).crs)

matprops is an array of text values that contains the cross hatch pattern names i.e "ISO (Aluminum)"

Cheers Craig

Reply to
Craig T

Try For Materials RetVal(1) = swModel.GetUserPreferenceDoubleValue(swMaterialPropertyCrosshatchScale) RetVal(2) = swModel.GetUserPreferenceDoubleValue(swMaterialPropertyCrosshatchAngle) RetVal(3) = swModel.GetUserPreferenceStringValue(swMaterialPropertyCrosshatchPattern)

For Views RetVal(4) = swApp.GetUserPreferenceDoubleValue(swDrawingAreaHatchScale) RetVal(5) = swApp.GetUserPreferenceDoubleValue(swDrawingAreaHatchAngle) RetVal(6) = swApp.GetUserPreferenceStringValue(swDrawingAreaHatchPattern)

-- Tony O'Hara Melbourne, Australia.

Part.SetUserPreferenceStringValue(swMaterialPropertyCrosshatchPattern,

Reply to
Tony O'Hara

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.