Reading out Tpointselection

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 14/07/2006 at 16:13, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   9.6 Demo 
Platform:   Windows  ;   
Language(s) :   C.O.F.F.E.E  ;

---------
HI !
mayby someone can help me. i want to read out the points in a Tpointselection tag. but have no idea how to do that.
main(doc,op)
{
     var tag = op->GetFirstTag();
     tag = tag->GetNext();
     tag = tag->GetNext();
     tag = tag->GetNext();
     var Type = tag->GetType();
     println(Type); // 5674 -> Tpointselection
     var name = tag->GetName();
     println(name); // "MySel1"
}
Any idea how to move on? Where are the points in the selectionTag?
Thx!

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 14/07/2006 at 23:22, xxxxxxxx wrote:

First, I would never depend upon a tag being in a particular place within the object's tag list. Do this:

for (tag = op->GetFirstTag(); tag; tag = tag->GetNext())
{
if (instanceof(tag, Tpointselection))
{
var select = ((PointSelectionTag* )tag)->GetSelection();
...
}
}

select is a BaseSelect class which contains an array which is the size of the number of points of the object. The points covered by the PointSelectionTag will be IsSelected(), the others not - think of this as an array of 1's and 0's. The selected points are 1, the others are 0. That is how a BaseSelect works, basically (same for PolygonSelectionTags as well). You can get the number of selected points in the array with select->GetCount().

= select->IsSelected(x)). You'll need to get the object's vertex with PointObject->GetPoint(x). Now you have a one-one correspondence between selected points (IsSelected(x)) and the actual vertex (GetPoint(x)).

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 15/07/2006 at 11:35, xxxxxxxx wrote:

I say THX Kuroyume! now it should work.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 15/07/2006 at 13:26, xxxxxxxx wrote:

Another short question.
Is it possible to export model/tag data via coffee in Cinema4D 9.6 DEMO!! ?? I dont get the filename or basefile classes to work... mayby someone can help at that point??? please 🙂
thx!

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 15/07/2006 at 17:46, xxxxxxxx wrote:

i fixed that problem. !