是德科技
直播中

张华

8年用户 1487经验值
私信 关注
[问答]

如何将部件复制到包含参数的库中?

我在EMPro项目中创建了一个参数化的实体模型。
我想把这个部分放在一个库中,以便它可以用在其他项目中。
该部分被拖入我的图书馆 - 它现在是图书馆的一部分。
但是,当我尝试在其他项目中使用该部件时,我收到一个错误,即未定义参数。
那么,如何将此部件复制到包含参数的库中?
谢谢

以上来自于谷歌翻译


     以下为原文

  I created a parametrized solid model in an EMPro project.  I want to put this Part in a Library so that it can be used in other projects.  The Part was dragged into my library--it's now a Part in the library.  However, when I try to use the part in other projects, I get an error that the parameters are not defined.  So, how do I copy this part to the library with the parameters included?

Thanks

回帖(3)

凌云志

2018-12-18 16:21:18
抱歉,EMPro尚不支持此功能。
当参数化零件保存到库中时,它将被“展平”(参数将由基于实例参数值的固定数值替换)。
这主要是为了防止同一项目中具有相同参数名称的2个库部件之间的参数冲突。
这将在未来的EMPro版本中得到解决。

以上来自于谷歌翻译


     以下为原文

  Sorry, this is not yet supported in EMPro.  When a parameterized part is saved to the library, it is 'flattened' (parameters are replaced by fixed numerical values based on the instance parameter values).  This is mainly to prevent parameter conflicts between 2 library parts with the same parameter name in the same project.  This will be addressed in a future release of EMPro.
举报

鄢蓉

2018-12-18 16:33:17
引用: 60user124 发表于 2018-12-18 06:36
抱歉,EMPro尚不支持此功能。
当参数化零件保存到库中时,它将被“展平”(参数将由基于实例参数值的固定数值替换)。
这主要是为了防止同一项目中具有相同参数名称的2个库部件之间的参数冲突。

对前一个帖子稍作修正。
* MarcP写道:* +抱歉,EMPro尚不支持此功能。
当参数化零件保存到库中时,它将被“展平”(参数将由基于实例参数值的固定数值替换)。
这主要是为了防止同一项目中具有相同参数名称的2个库部件之间的参数冲突。
这将在未来的EMPro版本中得到解决。+实际上,保存在库中的模型不会被展平。
它保留了参数。
但是,当您将此项目带到其他项目时,模型将不会显示,因为在项目中找不到参数。
只要您创建项目中使用的模型参数,您就可以看到生成的模型。
如果定义了许多参数,则重新定义所有参数可能会很麻烦。
一种解决方法是将已定义参数的项目保存为新项目,但在执行此操作之前将项目清空,例如删除不想使用的其他部分和定义。
然后将保存在库中的模型带入并构建一个新项目。
希望这可以帮助。

以上来自于谷歌翻译


     以下为原文

  A little correction to the previous thread. 

*MarcP wrote:*
+Sorry, this is not yet supported in EMPro. When a parameterized part is saved to the library, it is 'flattened' (parameters are replaced by fixed numerical values based on the instance parameter values). This is mainly to prevent parameter conflicts between 2 library parts with the same parameter name in the same project. This will be addressed in a future release of EMPro.+

Actually, the model saved in the library is not flattened. It keeps the parameters. However when you bring this to other project, the model won't be shown is because the parameters can't be found in the project. As soon as you create the parameters that the model used in the project, you will be able to see the model generated. 

If you have many parameters defined, it may be a hassle to redefine all of them again. One workaround is to save the project, where you have parameters defined, as a new project, but make the project empty before you do that such as deleting other parts and definitions you don't want to use.  Then bring the model saved in the library and build a new project. 

Hope this helps.
举报

潘晶燕

2018-12-18 16:39:38
我找到了解决python脚本这个问题的方法。
我编写了一个名为WriteParameterstoFile.py的脚本,您可以在要放入库中的部件的模型中运行该脚本。
它将所有参数写入文本文件。
我为目标项目编写了第二个脚本,您可以运行该脚本以从该文本文件导入参数。
到目前为止它的工作正常。
它不会覆盖具有相同名称的现有参数。
通过不必手动输入一组参数到新项目,它可以节省时间。
不是最优雅的编程,但我把它与很少的python经验一起扔了。
ReadParametersFromFile.py667字节

以上来自于谷歌翻译


     以下为原文

  I found a work around to this problem with python scripts.  I wrote script called WriteParameterstoFile.py that you run in the model of the part you wish to put in the library.  It writes all the parameters to a text file.  I wrote a second script for the destination project that you can run to import parameters from that text file.  So far its working ok.  It will not overwrite existing parameters with the same name.  It saves time by not having to enter in manually a bunch of parameters to the new project.  Not the most graceful programing but I threw it together with very little python experience.

附件

举报

更多回帖

发帖
×
20
完善资料,
赚取积分