美文网首页
【Fusion360API】 Simple-Extrudes 简

【Fusion360API】 Simple-Extrudes 简

作者: 孝吾 | 来源:发表于2018-03-27 17:54 被阅读55次
实现效果

在坐标原点创建一个半径为2cm高为5cm的圆柱

# -*- coding: utf-8 -*-
"""
Created on Tue Mar 27 16:02:30 2018

@author: xiaowu
"""

import adsk.core, adsk.fusion, traceback

def run(context):
    ui = None
    try: 
        app = adsk.core.Application.get()
        ui = app.userInterface
        #create new documents.创建一个新的文件
        doc = app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)

        design = app.activeProduct

        # Get the root component of the active design.
        rootComp = design.rootComponent

        # Create a new sketch on the xy plane.在XY平面创建草图
        sketches = rootComp.sketches
        xyPlane = rootComp.xYConstructionPlane
        sketch = sketches.add(xyPlane)

        # Draw a circle.创建一个圆
        circles = sketch.sketchCurves.sketchCircles
        circle1 = circles.addByCenterRadius(adsk.core.Point3D.create(0, 0, 0), 2)

        # Get the profile defined by the circle.*可以理解为选中这个圆吧。
        prof = sketch.profiles.item(0)

        # Define that the extent is a distance extent of 5 cm.设置拉伸高度5CM
        distance = adsk.core.ValueInput.createByReal(5)

        # Create the extrusion.
        extrudes = rootComp.features.extrudeFeatures
        ext = extrudes.addSimple(prof, distance, adsk.fusion.FeatureOperations.NewComponentFeatureOperation)
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

官方传送门: https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-20302b02-fd08-11e4-b923-3417ebd3d5be

相关文章

  • 【Fusion360API】 Simple-Extrudes 简

    在坐标原点创建一个半径为2cm高为5cm的圆柱 官方传送门: https://help.autodesk.com/...

  • 【Fusion360API】 Hello VScode!

    在最近的一次Fusion 360 的大更新中,除了Generative design 有更强的支持外,然后就是把A...

  • 【Fusion360API】开坑前的准备

    为什么我要学习FusionAPI 前段时间在研究使用Fusion360进行参数化建模,然后通过对想要表达的模型进行...

  • 【Fusion360API】如何通过API调用模型内部参数

    在参数管理器中调参数 在fusion360中,有着非常完备的参数管理。在参数化建模的环境下,可以通过参数管理器查询...

  • 简•简•简

    昨天包饺子剩下的面,和着葱花芝麻做了薄脆的煎饼,面揉揉再醒醒,仿佛唤醒一个贪睡的婴儿。待它伸展好了,擀得薄薄的,撒...

  • 简简还是简简么?

    简简还是简简么? 夏半笙 前天晚上,我...

  • 简简

    刚开始的时候都会很积极,每天都会来看我。 每天来关注的时候,我就会很开心呀,觉得全世界花儿都开啦~ 接下来,两天来...

  • 生活就是要简简简简简简简单的快乐

    如果时间久了觉得生活很复杂 记得一起齐聚果果的小屋 感受最简单的快乐哦 我们在这个小屋里 会把每一份可爱 每一份情...

  • 澳门简简简攻略

    (图文均为原创,转载请联系) 一场说走就走的旅行。 起先是老黎分享了两个闺蜜台湾游的游记,并提...

  • 简书,简简书

    简书对我来说,是个慢慢想,慢慢写的地方,是周末小憩,假日小休的地方,相当于一个茶室,一个书房,一个可以放松整理的地...

网友评论

      本文标题:【Fusion360API】 Simple-Extrudes 简

      本文链接:https://www.haomeiwen.com/subject/xhescftx.html