Module: DFC::Common::CurrentFloor

Overview

当前位置工具API

Class Method Summary # collapse

Class Method Details

.ent_in_area?(ent, area_pos) ⇒ True|False

判断群组(组件)是否在某个区域内

Examples:

ent = Sketchup.active_model.selection[0]
DFC::Common::CurrentFloor.ent_in_area?(ent,{"楼层"=>"1F","区域"=>nil,"房间"=>nil})

Parameters:

  • ent (Object)

    群组

  • area_pos (Object)

    指定区域 “楼层”=>“”,“区域”=>“”,“房间”=>“”

Returns:

  • (True|False)

.get_current_areaObject Also known as: getCurrentArea

获取当前选中位置

Examples:

DFC::Common::CurrentFloor.get_current_area
{
  "楼层":"1F",
  "区域":nil,
  "房间":"卧室"
}

.get_current_dataObject Also known as: getCurrentData

获取位置所有数据

Examples:

DFC::Common::CurrentFloor.get_current_data
[
  {
    "name":"1F",
    "entityID":0,
    "property":0,
    "children":[]
  },
  {
    "name":"2F",
    "entityID":0,
    "property":0,
    "children":[]
  }
]

.get_windowObject Also known as: getWindow

获取当前位置工具Dialog

Examples:

DFC::Common::CurrentFloor.get_window

.showObject

显示当前位置工具Dialog

Examples:

DFC::Common::CurrentFloor.show

.show_by_tool(tool_name, area = nil) {|hash| ... } ⇒ DFCUI::HtmlDialog

用于工具编辑是选择位置

Examples:

DFC::Common::CurrentFloor.show_by_tool("楼地面"){|res|
  dfc_puts res
}

Parameters:

  • tool_name

    工具名称 用于拼接标题

  • area (defaults to: nil)

    默认选择位置 “楼层”=>“1F”,“区域”=>nil,“房间”=>nil 默认为当前位置

Yields:

  • 返回数据

Yield Parameters:

  • hash ("dialog" =>窗口, "event" => 触发事件(add choose_area del edit), "area" => 触发事件后的位置)

Returns:

.toggleObject

显隐当前位置工具Dialog

Examples:

DFC::Common::CurrentFloor.toggle