Jump to content

GetType inside of a group


PeterT

Recommended Posts

How do you GetType of an object inside of a group?

I have a line inside of a group. If I enter the group and select the line, the OIP tells me that the selected object is a line. But if I run a vectorscript on this on this line with a GetType function it returns the integer 11 (group), not 1 (line).

In other words, a GetType function run on a selected object inside of a group finds the group not the selected object.

Is this working as intended, or is there some way around it?

Link to comment

I found this Tips last week.

procedure test_GetSObj;
const
SelectedObjects = 2;
TraverseShallow = 0;
EditableLayers = 4;
var
hSObj	:handle;

function DoObject(h:handle):boolean;
begin
	hSObj:= h;
	DoObject:= true;
end;{DoObject}

begin{main}
hSObj:= nil;
ForEachObjectInLayer(DoObject, SelectedObjects, TraverseShallow, EditableLayers);
if hSObj = nil then
	Message('object = none')
else
	Message('object type = ', GetType(hSObj));
end;
Run(test_GetSObj);

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...