|
大家好,我现在正在进行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 |
|