如何使用SketchUp Ruby将IFC信息写入skp文件

我想用ruby生成SketchUp模型,同时保存ifc信息。 这是我的代码: #1. create a group by l, b, h and transform group = = entities.clear!#clear = [l, = = = = definition.name + \"-001\"#3.2 define = [\"IFC 2x3\", \"IfcBeam\", = \"25 tons; crane beam\"success,> It can save the name, descritpion. My question is: How to save my User-defined properties? For example, how to save the IfcBeam\"s l, b ,h attributes. Have a look at the IFC exporter on github:GitHub 31BIM-Tools/SketchUp-IFC-Manager 31 IFC data manager and exporter for SketchUp. Contribute to BIM-Tools/SketchUp-IFC-Manager development by creating an account on GitHub. Thanks for your reply. I try to understand that plugin\"s code. The solution: # 1. create a group by l, b, h and transform group = = entities.clear!#clear = [l, = = = = = [\"IFC 2x3\", \"IfcBeam\", = = setAndGetIfc(path, ifc_prop, definition)# 4. define> Then,use the sketchup\"s export function(choose the ifc option) . Don\"t use the SketchUp-IFC-Manager. Please note that if you do not use the IFC Manager extension, the IFC export does not fully meet the \"requirements\" of buildingSMART. Thanks for attention. In the IFC Manager extension, I think t_ifcmanagerliblib_ifcIfcRelDefinesByProperties_su.rb is the key file. I post the code from line 43 to line 107: if sketchup.is_a?( Sketchup::AttributeDictionary == \"BaseQuantities\" # export = IfcManager::Ifc_Set.new()attr_dict.attribute_dictionaries.each { | dict |case dict.namewhen = BimTools::IFC2X3::IfcQuantityVolume.new( ifc_model, = BimTools::IfcManager::IfcIdentifier.new( = BimTools::IfcManager::IfcLabel.new( attr_dict.name ) unless == 0 && attr_dict.attribute_dictionariesattr_dict.attribute_dictionaries.each { | = BimTools::IfcManager::IfcBoolean.new( dict[\"value\"] = true returns a full object string, necessary for propertysetpset.hasproperties.add( prop )}elseattr_dict.each { | key, = true # adding> I think the IFC Manager accept thedictionary named as \"BaseQuantities\" and accept the keyname as\"Area\", \"GrossArea\", \"Width\", \"Height\", \"Depth\", \"Perimeter\" and so on. But when I try to write> and use the IFC Manager to export an IFC file, I can\"t find the \"BaseQuantities\" dictionary and the \"Width\", \"Height\", \"Depth\" in the IFC file. But if I use the sketchup\"s export, I can find them. I am really puzzled. I would appreciate it if you could give me some suggestion. The reply of SketchUp IFC manager plugin\"s author: At the moment there are two supported methods for writing properties. 1. Add AttributeDictionaries under the \"IFC 2x3\" dictionary. So they are part of the IFC data. Like when you import an IFC containing additional property sets. 2. Add AttributeDictionaries under the \"dynamic_attributes\" dictionary. To create parametric components (Only user-visible parameters starting with \"CPset_\" are exported). Like: https://3dwarehouse.sketchup.com/model/cf631169-453a-4f23-9a07-e1be52dfee38/ProvisionForVoid-Rectangle-IFC2X3 8 The IFC data set uses nested attribute dictionaries. \"Width\",\"Height\",\"Depth\"不是属性键,它们是嵌套的字典名,它们的值存储在名为\"Value\"的键中。 IFC数据也可以分配给定义而不是实例。 尝试这样的操作… def quantities(obj)return false if> DanRathbun: The IFC data may also be assigned to the definition and not the instance. This causes major import problems, because each element has to be unique, regardless if it is the same \"geometry\" or representation of. That would seriously reduce the amount of simular components were the only difference is the name… Edit: link to another post: \"make component\" takes very long, does not complete - too long to be productive ProAn extension will only get to work when the model is loaded, an importer might tackle the problems before? simple example: an ifc file with the size of 2.3 KB will result in a 37MB SketchUp file.KozijnenOnly.zip (388.2 KB) and it is just a few frames…[image]Notesextracted this ifc from a 280 MB file wich would result in a 4.5 GB SketchUp File, theoretically. It\"s so kind of you! Is my understanding correct? I think there is a dictionary named \"\"IFC 2x3\", and the \"IFC 2x3\" dictionary has a dictionary named \"BaseQuantities\". Then the \"BaseQuantities\" dictionary has the dictionary named \"Width\", \"Depth\", \"Height\". Each of \"Width\", \"Depth\", \"Height\" has the key named \"Value\". Can you teach me more about how to realize the nested dictionary? I can\"t find any threads about it in the SketchUp Ruby API documents. For example, I creat \"Width\", \"Depth\", \"Height\" dictionary in the lowest level. How to nest them inside the \"BaseQuantities\" dictionary and \"IFC 2x3\"> cloud1980_cn: Is my understanding correct? I think there is a dictionary named \"\"IFC 2x3\", and the \"IFC 2x3\" dictionary has a dictionary named \"BaseQuantities\". Then the \"BaseQuantities\" dictionary has the dictionary named \"Width\", \"Depth\", \"Height\". Each of \"Width\", \"Depth\", \"Height\" has the key named \"Value\". I believe based upon the code you quoted from BIMTools that you are correct, … IF it uses the same IFC dictionary that SketchUp uses. (It could use it\"s own dictionary if the author so desired.) cloud1980_cn: Can you teach me more about how to realize the nested dictionary? You should use an attribute dictionary viewer extension to view dictionaries. It will help in development. The 3 top extensions here you will find valuable for viewing attribute dictionaries … http://extensions.sketchup.com/en/search/site/attribute 6 I gave a straight forward example above. cloud1980_cn: I can\"t find any threads about it in the SketchUp Ruby API documents. You need to realize that Ruby is a class based language that uses inheritance. All Sketchup::Entity1子类继承它们的超类的方法。Sketchup::AttributeDictionary1类和Sketchup::AttributeDictionaries集合类都是Sketchup::Entity1的子类。 任何Sketchup::Entity1子类对象可以有一个Sketchup::AttributeDictionaries集合实例,其数量(在合理范围内)为Sketchup::AttributeDictionary1实例。 但由于Sketchup::AttributeDictionary1是Sketchup::Entity1的子类,因此它本身也可以有一个Sketchup::AttributeDictionaries集合实例,其数量(在合理范围内)为Sketchup::AttributeDictionary1实例。 以此类推……以此类推…等等… 谢谢你的时间和耐心。 我会按照你的指示去做。 大家好, 我很久以后才读这篇文章。 因为我的英语和国际金融公司都不太好,我需要你的确认。 在一个引文中,我试着为一堵墙写IFC属性,就像下面的代码一样,根据我从文章中了解到的:(可能对下一个读者有帮助) def setIFCu attributessetu dimensionsset@length=={\".{IFCu attribute}formulaunits\"=>;\"STRING\",\".{IFCu attribute}label\"=>;IFCu attribute,\".{IFCu attribute}formlabel\"=>;\"={ifcţ属性}\",\"={ifcţ属性}}单位\"=>;\"STRING\",\"==[\"ifc 2x3\",\"IfcWall\",\"ObjectType\",> 谢谢您的评论

admin_action_{$_REQUEST[‘action’]}

do_action( "admin_action_{$_REQUEST[‘action’]}" )动作钩子::在发送“Action”请求变量时激发。Action Hook: Fires when an ‘action’ request variable is sent.目录锚点:#说明#源码说明(Description)钩子名称的动态部分$_REQUEST['action']引用从GET或POST请求派生的操作。源码(Source)更新版本源码位置使用被使用2.6.0 wp-admin/admin.php:...

日期:2020-09-02 17:44:16 浏览:1163

admin_footer-{$GLOBALS[‘hook_suffix’]}

do_action( "admin_footer-{$GLOBALS[‘hook_suffix’]}", string $hook_suffix )操作挂钩:在默认页脚脚本之后打印脚本或数据。Action Hook: Print scripts or data after the default footer scripts.目录锚点:#说明#参数#源码说明(Description)钩子名的动态部分,$GLOBALS['hook_suffix']引用当前页的全局钩子后缀。参数(Parameters)参数类...

日期:2020-09-02 17:44:20 浏览:1065

customize_save_{$this->id_data[‘base’]}

do_action( "customize_save_{$this->id_data[‘base’]}", WP_Customize_Setting $this )动作钩子::在调用WP_Customize_Setting::save()方法时激发。Action Hook: Fires when the WP_Customize_Setting::save() method is called.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分,$this->id_data...

日期:2020-08-15 15:47:24 浏览:802

customize_value_{$this->id_data[‘base’]}

apply_filters( "customize_value_{$this->id_data[‘base’]}", mixed $default )过滤器::过滤未作为主题模式或选项处理的自定义设置值。Filter Hook: Filter a Customize setting value not handled as a theme_mod or option.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分,$this->id_date['base'],指的是设置...

日期:2020-08-15 15:47:24 浏览:892

get_comment_author_url

过滤钩子:过滤评论作者的URL。Filter Hook: Filters the comment author’s URL.目录锚点:#源码源码(Source)更新版本源码位置使用被使用 wp-includes/comment-template.php:32610...

日期:2020-08-10 23:06:14 浏览:928

network_admin_edit_{$_GET[‘action’]}

do_action( "network_admin_edit_{$_GET[‘action’]}" )操作挂钩:启动请求的处理程序操作。Action Hook: Fires the requested handler action.目录锚点:#说明#源码说明(Description)钩子名称的动态部分$u GET['action']引用请求的操作的名称。源码(Source)更新版本源码位置使用被使用3.1.0 wp-admin/network/edit.php:3600...

日期:2020-08-02 09:56:09 浏览:874

network_sites_updated_message_{$_GET[‘updated’]}

apply_filters( "network_sites_updated_message_{$_GET[‘updated’]}", string $msg )筛选器挂钩:在网络管理中筛选特定的非默认站点更新消息。Filter Hook: Filters a specific, non-default site-updated message in the Network admin.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分$_GET['updated']引用了非默认的...

日期:2020-08-02 09:56:03 浏览:859

pre_wp_is_site_initialized

过滤器::过滤在访问数据库之前是否初始化站点的检查。Filter Hook: Filters the check for whether a site is initialized before the database is accessed.目录锚点:#源码源码(Source)更新版本源码位置使用被使用 wp-includes/ms-site.php:93910...

日期:2020-07-29 10:15:38 浏览:829

WordPress 的SEO 教学:如何在网站中加入关键字(Meta Keywords)与Meta 描述(Meta Description)?

你想在WordPress 中添加关键字和meta 描述吗?关键字和meta 描述使你能够提高网站的SEO。在本文中,我们将向你展示如何在WordPress 中正确添加关键字和meta 描述。为什么要在WordPress 中添加关键字和Meta 描述?关键字和说明让搜寻引擎更了解您的帖子和页面的内容。关键词是人们寻找您发布的内容时,可能会搜索的重要词语或片语。而Meta Description则是对你的页面和文章的简要描述。如果你想要了解更多关于中继标签的资讯,可以参考Google的说明。Meta 关键字和描...

日期:2020-10-03 21:18:25 浏览:1710

谷歌的SEO是什么

SEO (Search Engine Optimization)中文是搜寻引擎最佳化,意思近于「关键字自然排序」、「网站排名优化」。简言之,SEO是以搜索引擎(如Google、Bing)为曝光媒体的行销手法。例如搜寻「wordpress教学」,会看到本站的「WordPress教学:12个课程…」排行Google第一:关键字:wordpress教学、wordpress课程…若搜寻「网站架设」,则会看到另一个网页排名第1:关键字:网站架设、架站…以上两个网页,每月从搜寻引擎导入自然流量,达2万4千:每月「有机搜...

日期:2020-10-30 17:23:57 浏览:1303