// Работает в JScript
// Выбор точек
sel = ui.selectEntity("Select Point (ENTER to Stop)", "SketchPoints,Vertices,ConstructionPoints");
var typ_sel = sel.objectType;
if( typ_sel != 'adsk::core::Selection' ){
break;
}
// Анализ и определение параметров
var enty = sel.entity;
typ_ent = enty.objectType;
var point;
if(typ_ent == 'adsk::fusion::SketchPoint'){
point = enty.worldGeometry;
}
if(typ_ent == 'adsk::fusion::BRepVertex'){
point = enty.geometry;
}
// Вытаскиваем параметры
var X = point.x;
var Y = point.y;
var Z = point.z;
Пробуем в С++
// ...
// Выбираем
// Create selection input
Ptr<SelectionCommandInput> selectionInput = inputs->addSelectionInput(commandId + "_selection", "Select", "Basic select command input");
if (!selectionInput)
return;
selectionInput->setSelectionLimits(0);
// ...
// Анализируем
Ptr<SelectionCommandInput> selectionInput = inputs->itemById(commandId + "_selection");
size_t k = 0;
if(selectionInput) k = selectionInput->selectionCount();
for( int ir = 0; ir < k; ir++){
Ptr<Selection> selection = selectionInput->selection(ir);
Ptr<Base> sktchObjct = selection->entity();
std::string str = sktchObjct->objectType();
if(str == "adsk::fusion::SketchPoint"){
ui->messageBox("str == 'adsk::fusion::SketchPoint'");
Ptr<Point2D> pnt2D = sktchObjct->worldGeometry();
}
if(str == "adsk::fusion::BRepVertex"){
ui->messageBox("str == 'adsk::fusion::BRepVertex'");
Ptr<Point3D> pnt3D = sktchObjct->Geometry();
}
}
}
Транслятор ругается на Geometry и worldGeometry
Говорит
Error:class "adsk::core::Base" не содержит члена "Geometry"
... "worldGeometry"
В Header поставил
#include <Core/CoreAll.h>
#include <Fusion/FusionAll.h>