- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I'm trying to get the coords of the start point of a user selected line inside a sketch. I have managed to get the entity and test that it is a line, but how do I then get the line ID of the entity so i can get the coords?
I *think* it might be something to do with cast but I really can't work it out!
thanks in advance!
Ptr<Selection> selection1 = ui->activeSelections()->item(0);
Ptr<Base> selectedEnt1 = selection1->entity();
if (selectedEnt1->objectType() != LINE_TYPE) {
ui->messageBox("Selected entities are not sketch lines.");
return false;
}
int ID = *HOW DO I GET THIS?*
Ptr <Point3D> p0 = lines->item(ID)->startSketchPoint()->worldGeometry();
double x = p0->x();
double y = p0->y();
double z = p0->z();
Solved! Go to Solution.