SolidWorks机械工程师网——最大的SolidWorks学习平台

 找回密码
 立即注册

QQ登录

只需一步,快速开始

好品数字
好品数字
查看: 2579|回复: 2
打印 上一主题 下一主题

这个SolidWorks异常是什么意思?(已解决)

[复制链接]

7

主题

221

帖子

13

金币

侠客

Rank: 3Rank: 3Rank: 3

积分
255
QQ
跳转到指定楼层
楼主
发表于 2013-1-6 10:40:11 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
  
大家好,我现在正在进行SolidWorks的二次开发,具体的要求是能够读取和修改焊件清单中的字段属性,为了达到这个目的,我利用了SolidWorks自带的API接口,开发平台采用Microsoft visual studio 2012旗舰版,源代码从API的帮助里面复制,编译源代码,VS2012报错,错误内容如图1:

图1
请教问题的根源。

附源代码:
<font face="宋体"><font size="5">using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Text;
using SolidWorks.Interop.swdocumentmgr;
class Program
{
static void Main(string args)
{
SwDMClassFactory swClassFact = default(SwDMClassFactory);
SwDMApplication swDocMgr = default(SwDMApplication);
SwDMDocument10 swDocument10 = default(SwDMDocument10);
SwDMDocument13 swDocument13 = default(SwDMDocument13);
string sDocFileName = null;
SwDmDocumentType nDocType = default(SwDmDocumentType);
SwDmDocumentOpenError nRetVal = default(SwDmDocumentOpenError);
string sLicenseKey = null;
sLicenseKey =
"0000 0000 0000 3486 Q5HF FG98";
// Specify your SolidWorks Document Manager license key
sDocFileName = ("Crogram FilesSolidWorks CorpSolidWorkssamplestutorialweldmentsweldment_box2.sldprt");
// Specify your model document
nDocType = SwDmDocumentType.swDmDocumentPart;
swClassFact =
new SwDMClassFactory();
swDocMgr = swClassFact.GetApplication(sLicenseKey);
swDocument10 = (
SwDMDocument10)swDocMgr.GetDocument(sDocFileName, nDocType, false, out nRetVal);
swDocument13 = (
SwDMDocument13)swDocument10;
Debug.Print("Last Update Stamp: " + swDocument13.GetLastUpdateTimeStamp());
object vCutListItems = null;
vCutListItems = (
object)swDocument13.GetCutListItems2();
SwDMCutListItem2 Cutlist = default(SwDMCutListItem2);
long I = 0;
SwDmCustomInfoType nType = 0;
string nLink = null;
long J = 0;
object vPropNames = null;
Debug.Print("GET CUT-LIST ITEM");
for<font color="black"> (I = 0; I
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播 分享教程|习题|模型|技巧 点赞点赞14431 拍砖拍砖1238
SolidWorks机械工程师网
提示:建议使用谷歌浏览器浏览本网站!如单击这里下载!否则,可能无法下载附件文件!(支持大多数版本的谷歌浏览器,支持360和QQ浏览器的极速模式,即谷歌内核模式,使用IE和Edge浏览器,浏览个别网页以及下载文件时,会误报“***不安全”,此时需要单击“继续访问此不安全站点(不推荐)”才可以继续下载,另外,本网站不含任何不安全的文件,已联系微软公司解决,纯属IE和Edge浏览器误报)
回复

使用道具 举报

10

主题

212

帖子

24

金币

侠客

Rank: 3Rank: 3Rank: 3

积分
256
QQ
沙发
发表于 2013-1-6 10:41:13 | 只看该作者
  
sLicenseKey = &quot;0000 0000 0000 3486 Q5HF FG98&quot;;
这句不对,要到SolidWorks网站提交,返回来的才是,一般是48位的数字字母组合
SolidWorks机械工程师网
提示:建议使用谷歌浏览器浏览本网站!如单击这里下载!否则,可能无法下载附件文件!(支持大多数版本的谷歌浏览器,支持360和QQ浏览器的极速模式,即谷歌内核模式,使用IE和Edge浏览器,浏览个别网页以及下载文件时,会误报“***不安全”,此时需要单击“继续访问此不安全站点(不推荐)”才可以继续下载,另外,本网站不含任何不安全的文件,已联系微软公司解决,纯属IE和Edge浏览器误报)
回复 支持 反对

使用道具 举报

91

主题

314

帖子

176

金币

侠客

Rank: 3Rank: 3Rank: 3

积分
490
板凳
发表于 2013-1-6 10:49:23 | 只看该作者
License Key获取流程:
1.登陆solidworks网站([url=http://www.solidworks.com]www.solidworks.com[/url])通过customer portal登陆
2.点击My Support下的API Support
3.点Document Manager key
4.记录并保存好 license key.
SolidWorks机械工程师网
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭 卷起
关闭 卷起

手机版|小黑屋| GMT+8, 2024-4-30 04:21 , Processed in 0.160005 second(s), 40 queries .

SolidWorks机械工程师网 ( 鲁ICP备14025122号-2 ) 鲁公网安备 37028502190335号

声明:本网言论纯属发表者个人意见,与本网立场无关。
如涉版权,可发邮件: admin@swbbsc.com

快速回复 返回顶部 返回列表