3.1 系统选项
let systemOptions(swApp: ISldWorks) =
swApp.SetUserPreferenceToggle(int swUserPreferenceToggle_e.swInputDimValOnCreate, true)
swApp.GetUserPreferenceToggle(int swUserPreferenceToggle_e.swInputDimValOnCreate)
|> sprintf "%b"
|> swApp.SendMsgToUser
swApp.SetUserPreferenceToggle(int swUserPreferenceToggle_e.swInputDimValOnCreate, true)
swApp.SetUserPreferenceDoubleValue(int swUserPreferenceDoubleValue_e.swDrawingDetailViewScale, 1.5)
|> ignore
swApp.GetUserPreferenceDoubleValue(int swUserPreferenceDoubleValue_e.swDrawingDetailViewScale)
|> sprintf "%f"
|> swApp.SendMsgToUser
let viewportColor = Color.FromArgb(128, 255, 128).ToArgb()
swApp.SetUserPreferenceIntegerValue(int swUserPreferenceIntegerValue_e.swSystemColorsViewportBackground, viewportColor)
|> ignore
swApp.GetUserPreferenceIntegerValue(int swUserPreferenceIntegerValue_e.swSystemColorsViewportBackground)
|> sprintf "%d"
|> swApp.SendMsgToUser
let value = @"C:\Temp"
swApp.SetUserPreferenceStringValue(int swUserPreferenceStringValue_e.swBackupDirectory, value)
|> ignore
swApp.GetUserPreferenceStringValue(int swUserPreferenceStringValue_e.swBackupDirectory)
|> swApp.SendMsgToUser
swApp.SetUserPreferenceIntegerValue(
int swUserPreferenceIntegerValue_e.swEdgesHiddenEdgeDisplay,
int swEdgesHiddenEdgeDisplay_e.swEdgesHiddenEdgeDisplayDashed)
|> ignore
// View Rotation - Mouse Speed
//
// 0 = Slow
// 100 = Fast
swApp.SetUserPreferenceIntegerValue(int swUserPreferenceIntegerValue_e.swViewRotationMouseSpeed, 50)
|> ignore
// View Rotation - ViewAnimationSpeed
// 0 = Off
// 0.5 = Fast
// 1.0
// 1.5
// 2.0
// 2.5
// 3.0 = Slow
swApp.SetUserPreferenceDoubleValue(int swUserPreferenceDoubleValue_e.swViewAnimationSpeed, 2.0)
|> ignore
标签:swUserPreferenceToggle,swApp,int,solidworks,ch03,ignore,api,swUserPreferenceInte
From: https://www.cnblogs.com/cuishengli/p/17536614.html