API help for Setting Hatch pattern

Sep 03, 2003 3 Replies

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


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

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

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,

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required