做网站还要写文章吗,百度一直不收录网站,郑州专业的网站建设公司排名,简诉网站建设的基本流程我已经在用宏编辑器构建的Catia V5中编写了一些宏#xff0c;但我无法弄清楚如何从Excel访问Catia命令 .我想知道如何通过仅在excel文件圆柱体的半径和长度中创建一个简单的直圆柱体 .我想在Catia中输入不同的压力容器#xff0c;在Excel中输入它们的直径和高度#xff0c;然…我已经在用宏编辑器构建的Catia V5中编写了一些宏但我无法弄清楚如何从Excel访问Catia命令 .我想知道如何通过仅在excel文件圆柱体的半径和长度中创建一个简单的直圆柱体 .我想在Catia中输入不同的压力容器在Excel中输入它们的直径和高度然后点击那张excel表中的按钮后容器应该出现在Catia中 . 如果我已经需要在Catia中打开一个空的部分我没有问题但最好只是让Catia打开而不加载任何东西 .如果我有一个开始看看如何从Excel访问Catia方法我想我可以找出完成容器所需的其余方法如颈部帽子等 .谢谢 .编辑我设法测试了一些东西我遇到了一个问题我不知道如何在Excel vba中设置约束 . 我将代码从Catia vb移动到Visual Express并设法使其在那里工作但是在excel中我没有找到关于如何使用驱动维度的链接 .这是我的代码Sub Main()Dim CATIA As ObjectSet CATIA GetObject(, CATIA.Application)Set openDocument CATIA.ActiveDocumentSet currentPart openDocument.PartSet currentHybridBodies currentPart.HybridBodiesSet currentHybridBody currentHybridBodies.Add()Set referenceHybridBody currentPart.CreateReferenceFromObject(currentHybridBody)currentPart.HybridShapeFactory.ChangeFeatureName referenceHybridBody, GeometricalSetSet partOriginElements currentPart.OriginElementsSet plnYZ currentPart.OriginElements.PlaneYZSet currentGeometricalSet currentPart.HybridShapeFactoryDim currentOffset As IntegerDim circleDiameter As IntegerDim cylinderLength As IntegercurrentOffset 0circleDiameter Range(B2).ValuecylinderLength Range(B3).ValueCall CreateCylinder(0, 0, circleDiameter, cylinderLength, currentOffset)currentPart.UpdatecurrentOffset currentOffset cylinderLengthcircleDiameter Range(B5).ValuecylinderLength Range(B6).ValueCall CreateCylinder(0, 0, circleDiameter, cylinderLength, currentOffset)openDocument.Part.UpdatecurrentOffset currentOffset cylinderLengthcircleDiameter Range(B8).ValuecylinderLength Range(B9).ValueCall CreateCylinder(0, 0, circleDiameter, cylinderLength, currentOffset)currentPart.UpdatecurrentOffset currentOffset cylinderLengthCATIA.ActiveWindow.ActiveViewer.ReframeEnd SubSub CreateCylinder(iCenterX, iCenterY, iDiameter, iLength, iPlaneOffset)Set CATIA GetObject(, CATIA.Application)Set openDocument CATIA.ActiveDocumentSet currentPart openDocument.PartSet plnYZ currentPart.OriginElements.PlaneYZSet currentGeometricalSet currentPart.HybridShapeFactorySet planeOffset1 currentGeometricalSet.AddNewPlaneOffset(plnYZ, iPlaneOffset, False)Set currentHybridBody currentPart.HybridBodies.Item(GeometricalSet)currentHybridBody.AppendHybridShape (planeOffset1)openDocument.Part.UpdateSet currentBodies currentPart.BodiesSet currentBody currentBodies.Add()Set currentSketch currentBody.Sketches.Add(planeOffset1)Dim Factory2D As ObjectSet Factory2D currentSketch.OpenEditionSet geometricElements1 currentSketch.GeometricElementsDim axis2D1 As ObjectSet axis2D1 geometricElements1.Item(AbsoluteAxis)Dim line2D1 As ObjectSet line2D1 axis2D1.GetItem(HDirection)Dim line2D2 As ObjectSet line2D2 axis2D1.GetItem(VDirection)Set currentCircle Factory2D.CreateClosedCircle(iCenterX, iCenterY, iDiameter / 2)Dim point2D1 As ObjectSet point2D1 axis2D1.GetItem(Origin)Dim constraints1 As ObjectSet constraints1 currentSketch.ConstraintsDim reference2 As ObjectSet reference2 currentPart.CreateReferenceFromObject(currentCircle)Dim constraint1 As ObjectSet constraint1 constraints1.AddMonoEltCst(catCstTypeRadius, reference2)Dim catCstModeDrivingDimensions As ObjectSet constraint1.Mode catCstModeDrivingDimensions Here I get the errorDim iRadius As DoubleiRadius iDiameter / 2currentCircle.CenterPoint point2D1currentSketch.CloseEditionDim newPad As ObjectSet newPad currentPart.ShapeFactory.AddNewPad(currentSketch, iLength)End Sub在该注释行上我得到错误438对象不支持此属性或方法 .代码在没有该行的情况下工作但几何元素不受约束相反它们看起来是固定的我不希望这样 .该代码在Visual Express中工作正常并将所有约束放在应有的位置 .任何人都可以告诉我如何将Catia命令链接到excel vb .这是来自v5自动化文档枚举CatConstraintMode {catCstModeDrivingDimensioncatCstModeDrivenDimension}此外对我的代码的任何反馈表示赞赏 .谢谢 .编辑我似乎可以导入的唯一引用是references如果我选择其他人则会收到错误加载DLL时出错 . Catia安装在服务器上但是我可以使用Browse指向它...我仍然不确定在那里选择什么因为有很多文件 .