C# Solidworks二次开发:控制鼠标移动相关API详解

大家好,今天要介绍的是关于如何solidworks中用程序API来控制鼠标移动和滚轮缩放的功能。

下面是相关API:

(1)第一个为Move,这个API的含义为在窗口空间中移动鼠标指针,下面是官方的具体解释:

其输入参数有4个,第一个为X方向移动的数值,第二个为Y方向移动的数值,第三个为Z方向移动的数值,第四个为鼠标的定义命令swMouse_e,下面是所有命令对应的类型:

MemberDescription
swMouse_Absolute256 or 0x100
swMouse_Click512 or 0x200
swMouse_DoubleClick1024 or 0x400
swMouse_LeftDown2 or 0x2
swMouse_LeftUp4 or 0x4
swMouse_MiddleDown32 or 0x20
swMouse_MiddleUp64 or 0x40
swMouse_MouseMove1 or 0x1
swMouse_RightClick2048 or 0x800
swMouse_RightDoubleClick4096 or 0x1000
swMouse_RightDown8 or 0x8
swMouse_RightUp16 or 0x10
swMouse_SelectANNOTATIONTABLES0x620000; filters mouse selections to annotation tables
swMouse_SelectANNOTATIONVIEW0x8b0000; filters mouse selections to annotation views
swMouse_SelectARROWS0x310000; filters mouse selections to arrows
swMouse_SelectATTRIBUTES0x80000; filters mouse selections to attributes
swMouse_SelectBLOCKDEF0x630000; filters mouse selections to block definitions
swMouse_SelectBLOCKINST0x5d0000; filters mouse selections to block instances
swMouse_SelectBODYFEATURES0x160000; filters mouse selections to body features
swMouse_SelectBODYFOLDER0x760000; filters mouse selections to body folders
swMouse_SelectBOMFEATURES0x610000; filters mouse selections to BOM features
swMouse_SelectBOMS0x360000; filters mouse selections to BOMs
swMouse_SelectBOMTEMPS0x400000; filters mouse selections to BOM templates
swMouse_SelectBorder0xfe0000; filters mouse selections to borders
swMouse_SelectBREAKLINES0x1f0000; filters mouse selections to breaklines
swMouse_SelectBROWSERITEM0x450000; filters mouse selections to browser items
swMouse_SelectCAMERAS0x880000; filters mouse selections to cameras
swMouse_SelectCENTERLINES0x670000; filters mouse selections to centerlines
swMouse_SelectCENTERMARKS0x1c0000; filters mouse selections to centermarks
swMouse_SelectCENTERMARKSYMS0x640000; filters mouse selections to centermark symbols only
swMouse_SelectCOMMENT0x7f0000; filters mouse selections to comments
swMouse_SelectCOMMENTSFOLDER0x7e0000; filters mouse selections to comment folders
swMouse_SelectCOMPONENTS0x140000; filters mouse selections to components
swMouse_SelectCOMPPATTERN0x250000; filters mouse selections to component patterns
swMouse_SelectCOMPSDONTOVERRIDE0x480000; filters mouse selections to specified selection types (e.g., edges, vertices, or faces) over the competing component selection type in an assembly
swMouse_SelectCONFIGURATIONS0x2f0000; filters mouse selections to configurations
swMouse_SelectCONNECTIONPOINTS0x420000; filters mouse selections to connection points
swMouse_SelectCOORDSYS0x3d0000; filters mouse selections to coordinate systems
swMouse_SelectCOSMETICWELDS0xdc0000; filters mouse selections to cosmetic welds 
swMouse_SelectCTHREADS0x270000; filters mouse selections to cosmetic threads 
swMouse_SelectCUSTOMSYMBOLS0x3c0000; filters mouse selections to custom symbols 
swMouse_SelectDATUMAXES0x50000; filters mouse selections to datum axes
swMouse_SelectDATUMLINES0x3e0000; filters mouse selections to datum lines
swMouse_SelectDATUMPLANES0x40000; filters mouse selections to datum planes
swMouse_SelectDATUMPOINTS0x60000; filters mouse selections to datum points
swMouse_SelectDATUMTAGS0x240000; filters mouse selections to datum tags
swMouse_SelectDCABINETS0x2a0000; filters mouse selections to D cabinets
swMouse_SelectDETAILCIRCLES0x110000; filters mouse selections to detail circles
swMouse_SelectDIMENSIONS0xe0000; filters mouse selections to dimensions
swMouse_SelectDISPLAYSTATE0x940000; filters mouse selections to display states
swMouse_SelectDOCSFOLDER0x7d0000; filters mouse selections to document folders
swMouse_SelectDOWELSYMS0x560000; filters mouse selections to dowel symbols
swMouse_SelectDRAWINGVIEWS0xc0000; filters mouse selections to drawing views
swMouse_SelectDTMTARGS0x280000; filters mouse selections to datum targets
swMouse_SelectEDGES65536 or 0x10000; filters mouse selections to edges
swMouse_SelectEMBEDLINKDOC0x7b0000; filters mouse selections to embedded document links
swMouse_SelectEMPTYSPACE0x480000; filters mouse selections to empty spaces
swMouse_SelectEQNFOLDER0x370000; filters mouse selections to equations folders
swMouse_SelectEXCLUDEMANIPULATORS0x6f0000; filters mouse selections to exclude manipulators
swMouse_SelectEXPLLINES0x2d0000; filters mouse selections to explode lines
swMouse_SelectEXPLSTEPS0x2c0000; filters mouse selections to explode steps
swMouse_SelectEXPLVIEWS0x2b0000; filters mouse selections to explode views
swMouse_SelectEXTSKETCHPOINTS0x190000; filters mouse selections to sketch points 
swMouse_SelectEXTSKETCHSEGS0x180000; filters mouse selections to sketch segments 
swMouse_SelectEXTSKETCHTEXT0x580000; filters mouse selections to sketch text
swMouse_SelectFABRICATEDROUTE0x460000; filters mouse selections to a fabricated routes
swMouse_SelectFACES131072 or 0x20000; filters mouse selections to faces
swMouse_SelectFRAMEPOINT0x4d0000; filters mouse selections to frame points
swMouse_SelectFTRFOLDER0x5e0000; filters mouse selections to feature folders
swMouse_SelectGENERALTABLEFEAT0x8e0000; filters mouse selections to general table features
swMouse_SelectGTOLS0xd0000; filters mouse selections to Gtols
swMouse_SelectHELIX0x1a0000; filters mouse selections to helixes
swMouse_SelectHOLESERIES0x530000; filters mouse selections to hole series
swMouse_SelectHOLETABLEAXES0x690000; filters mouse selections to hole table axes
swMouse_SelectHOLETABLEFEATS0x680000; filters mouse selections to hole table features
swMouse_SelectIMPORTFOLDER0x390000; filters mouse selections to import folders
swMouse_SelectINCONTEXTFEAT0x1d0000; filters mouse selections to in-context features
swMouse_SelectINCONTEXTFEATS0x200000; filters mouse selections to in-context features
swMouse_SelectJOURNAL0x7c0000; filters mouse selections to journals
swMouse_SelectLEADERS0x540000; filters mouse selections to leaders
swMouse_SelectLIGHTS0x490000; filters mouse selections to lights
swMouse_SelectMAGNETICLINES0xe10000; filters mouse selections to magnetic lines 
swMouse_SelectMANIPULATORS0x4f0000; filters mouse selections to manipulators
swMouse_SelectMATEGROUP0x1e0000; filters mouse selections to mate groups
swMouse_SelectMATEGROUPS0x210000; filters mouse selections to multiple mate groups
swMouse_SelectMATES0x150000; filters mouse selections to mates
swMouse_SelectMATESUPPLEMENT0x8a0000; filters mouse selections to mate supplemental faces
swMouse_SelectMIDPOINTS0x3b0000; filters mouse selections to midpoints
swMouse_SelectNOTES0xf0000; filters mouse selections to notes
swMouse_SelectOBJGROUP0xcf0000; filters mouse selections to object groups
swMouse_SelectOBJHANDLES0x300000; filters mouse selections to object handles
swMouse_SelectOLEITEMS0x70000; filters mouse seletions to OLE items
swMouse_SelectPICTUREBODIES0x500000; filters mouse selections to picture bodies 
swMouse_SelectPLANESECTIONS0xdb0000; filters mouse selections to plane sections
swMouse_SelectPOINTREFS0x290000; filters mouse selections to point references 
swMouse_SelectPOSGROUP0x440000; filters mouse selections to mate reference folders
swMouse_SelectPUNCHTABLEFEATS0xea0000; filters mouse selections to punch table features
swMouse_SelectREFCURVES0x170000; filters mouse selections to reference curves 
swMouse_SelectREFEDGES0x330000; filters mouse selections to reference edges 
swMouse_SelectREFERENCECURVES0x1a0000; filters mouse selections to reference curves 
swMouse_SelectREFFACES0x340000; filters mouse selections to reference faces 
swMouse_SelectREFSILHOUETTE0x350000; filters mouse selections to reference silouettes
swMouse_SelectREFSURFACES0x1b0000; filters mouse selections to reference surfaces
swMouse_SelectREVISIONCLOUDS0xf00000; filters mouse selections to revision clouds 
swMouse_SelectREVISIONTABLE0x710000; filters mouse selections to revision tables
swMouse_SelectREVISIONTABLEFEAT0x770000; filters mouse selections to revision table features
swMouse_SelectROUTECURVES0x3f0000; filters mouse selections to route curves
swMouse_SelectROUTEPOINTS0x410000; filters mouse selections to route points 
swMouse_SelectROUTESWEEPS0x430000; filters mouse selections to route sweeps
swMouse_SelectSECTIONLINES0x100000; filters mouse selections to section lines
swMouse_SelectSECTIONTEXT0x120000; filters mouse selections to section text
swMouse_SelectSELECTIONSETFOLDER0x1020000; filters mouse selections to selection set folders
swMouse_SelectSELECTIONSETNODE0x1030000; filters mouse selections to selection set nodes
swMouse_SelectSFSYMBOLS0x230000; filters mouse selections to SF symbols 
swMouse_SelectSHEETS0x130000; filters mouse selections to sheets
swMouse_SelectSILHOUETTES0x2e0000; filters mouse selections to silhouettes
swMouse_SelectSIMELEMENT0x660000; filters mouse selections to simulation elements
swMouse_SelectSIMULATION0x650000; filters mouse selections to simulation studies
swMouse_SelectSKETCHBITMAP0x550000; filters mouse selections to sketch bitmaps
swMouse_SelectSKETCHCONTOUR0x600000; filters mouse selections to sketch contours
swMouse_SelectSKETCHES0x90000; filters mouse selections to sketches
swMouse_SelectSKETCHHATCH0x380000; filters mouse selections to sketch hatches
swMouse_SelectSKETCHPOINTFEAT0x470000; filters mouse selections to sketch point features
swMouse_SelectSKETCHPOINTS0xb0000; filters mouse selections to sketch points
swMouse_SelectSKETCHREGION0x5f0000; filters mouse selections to sketch regions
swMouse_SelectSKETCHSEGS0xa0000; filters mouse selections to sketch segments
swMouse_SelectSKETCHTEXT0x220000; filters mouse selections to sketch text
swMouse_SelectSOLIDBODIES0x4c0000; filters mouse selections to solid bodies
swMouse_SelectSOLIDBODIESFIRST0x510000; filters mouse selections to solid bodies over competing selection types (e.g., face, component)
swMouse_SelectSUBATOMFOLDER0x790000; filters mouse selections to body folders
swMouse_SelectSUBSKETCHDEF0x9a0000; filters mouse selections to sketch block definitions
swMouse_SelectSUBSKETCHINST0x720000; filters mouse selections to sketch block instances
swMouse_SelectSUBWELDFOLDER0x6b0000; filters mouse selections to sub-weldment folders
swMouse_SelectSURFACEBODIES0x4b0000; filters mouse selections to surface bodies
swMouse_SelectSURFBODIESFIRST0x4e0000; filters mouse selections to surface bodies over competing selection types (e.g., face, component)
swMouse_SelectSWIFTANNOTATIONS0x820000; filters mouse selections to Swift annotations
swMouse_SelectSWIFTFEATURES0x840000; filters mouse selections to Swift features
swMouse_SelectSWIFTSCHEMA0x9f0000; filters mouse selections to Swift schemas
swMouse_SelectTITLEBLOCK0xc00000; filters mouse selections to title blocks
swMouse_SelectTITLEBLOCKTABLEFEAT0xce0000; filters mouse selections to title block table features
swMouse_SelectVERTICES196608 or 0x30000; filters mouse selections to vertexes
swMouse_SelectVIEWERHYPERLINK0x3a0000; filters mouse selections to viewer hyperlinks
swMouse_SelectWELDBEADS0x7a0000; filters mouse selections to weld beads
swMouse_SelectWELDMENT0x6a0000; filters mouse selections to weldments
swMouse_SelectWELDMENTTABLEFEATS0x740000; filters mouse selections to weldment table features
swMouse_SelectWELDS0x260000; filters mouse selections to welds
swMouse_SelectWIREBODIES0x4a0000; filters mouse selections to wire bodies 
swMouse_SelectZONES0x320000; filters mouse selections to zones
swMouse_Wheel128 or 0x80

(2)第二个为MoveXYZ,这个API的含义为在模型空间中移动鼠标指针,下面是官方的具体解释:

其输入参数有4个,第一个为X方向移动的数值,第二个为Y方向移动的数值,第三个为Z方向移动的数值,第四个为鼠标的定义命令swMouse_e。其参数值和上面的一致。

(3)第三个为MouseWheelXYZ,这个API的含义为使用鼠标放大或缩小,下面是官方的具体解释:

本篇文章要介绍的就是这么多,我们下篇文章再见。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/616189.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【linux】网络 - 传输层 -- socket(TCP/UDP)

文章目录 socket预备知识TCP和UDP 协议网络字节序 socket接口及辅助接口sockaddrudpserver和udpclient初始化udp服务器运行udp服务器udp客户端 tcpserver和tcpclient初始化服务器运行服务器Tcp客户端 守护进程 socket Socket(套接字)是计算机网络编程中…

OpenCV C++学习笔记

1.图像的读取与显示 1.1 加载并显示一张图片 #include<opencv2/opencv.hpp> #include<iostream>using namespace cv; using namespace std; int main(int argc,char** argv){Mat srcimread("sonar.jpg");//读取图像if(src.empty()){printf("Could…

Presto Player 2.0 – 引人入胜的视频播放列表

Presto Player 2.0 引入了一项令人惊叹的新功能&#xff1a;视频播放列表。 将其与类似 Netflix 的新体验相结合&#xff0c;您将发现一款流畅的视频播放器&#xff0c;其功能在市场上任何其他工具中都找不到。 让我们看看 Presto Player 2.0 如何将您的内容提升到新的参与度…

使用 HBuilderX自动上传Uniapp 微信小程序代码

HBuilderX内置相关环境&#xff0c;开箱即用&#xff0c;无需配置nodejs。本文只介绍发布微信小程序的步骤。 1.下载和安装 HBuilderX hbuilder首页&#xff1a;https://www.dcloud.io/hbuilderx.html 下载hbuilder编辑器,选择对应的系统,Windows和mac正式版即可,下载后免安…

代码随想录算法训练营DAY25|C++回溯算法Part.2|216. 组合总和III、17.电话号码的字母组合

文章目录 216. 组合总和III题意理解树形结构伪代码实现剪枝操作CPP代码实现 17.电话号码的字母组合解题思路树形结构伪代码实现隐藏回溯CPP代码 216. 组合总和III 力扣题目链接 文章讲解&#xff1a;216. 组合总和III 视频讲解&#xff1a;和组合问题有啥区别&#xff1f;回溯算…

Vue-B站学习笔记

1. 路由配置 B站视频之Vue route文件下的index.js app.vue

几分钟!你的PDF文件就可以具有仿真翻页的效果!

你是否曾经在阅读PDF文件时感到困扰&#xff0c;因为它的页面是静态的&#xff0c;无法模拟真实的翻页效果&#xff1f;现在&#xff0c;我教你一个很实用的方法&#xff1a;几分钟&#xff01;你的PDF文件就可以具有仿真翻页的效果&#xff01; 工具&#xff1a;FLBOOK在线制作…

叉车载货出入库AI检测算法介绍及应用

随着物流行业的快速发展&#xff0c;叉车作为物流运输的重要设备&#xff0c;其安全性和效率性越来越受到人们的关注。然而&#xff0c;在实际操作中&#xff0c;由于人为因素和操作环境的复杂性&#xff0c;叉车事故时有发生&#xff0c;给企业和个人带来了巨大的损失。为了提…

langchain 文本向量化存储,并检索相似 topK

目录 chroma 检索 faiss 检索 检索器 相似性 最大相关性mmr 相似数阈值 txt 有多行&#xff0c;我的这份数据有 67 行&#xff0c;样例如下&#xff1a; 字段1\t值1\n 字段2\t值2\n ... chroma 检索 pip install langchain-chroma 在本地下载了 embedding 模型&…

kali工具----网络映射器(Network Mapper)

识别活跃的主机 尝试渗透测试之前&#xff0c;必须先识别在这个目标网络内活跃的主机。在一个目标网络内&#xff0c;最简单的方法将是执行ping命令。当然&#xff0c;它可能被一个主机拒绝&#xff0c;也可能被接收。本节将介绍使用Nmap工具识别活跃的主机。 1、网络映射器工具…

突破编程_前端_SVG(rect 矩形)

1 rect 元素的基本属性和用法 在SVG中&#xff0c;<rect> 元素用于创建矩形。 <rect> 元素有一些基本的属性&#xff0c;可以用来定义矩形的形状、位置、颜色等。以下是这些属性的详细解释&#xff1a; x 和 y &#xff1a;这两个属性定义矩形左上角的位置。 x …

智慧公厕:忙时不顶用,闲时没啥用的玩意。

智慧公厕是一种利用智能科技和物联网技术来提升公厕管理和用户体验的新型公厕形式。它通过集成各种智能设备和传感器&#xff0c;实现自动感应、自动清、自动消毒等功能&#xff0c;以提供更便捷、卫生、舒适的使用体验。 在忙时&#xff0c;智慧公厕能够提供更高效的服务。例如…