Jump to content
Developer Wiki and Function Reference Links ×

Convert to Group.


Assembly

Recommended Posts

the object is a custom pio.

i thought that DoMenuScriptByName was not advisable.

I have tried to use

ungroup;

SymbolToGroup(objecthandle,1);

Documentation says that

1: Convert plug-in and symbol subobjects.

this has not been successful

Why I want this function.

I have a PIO that creates 3 extrudes used to to SubtractSolid from a number of other PIO's. I think if I can convert to a group I can get a handle to each object in the group.

Any other suggestions?.

Link to comment

Here is a code to create objects called 03Extrudes

Procedure ChangeThis1;

VAR

hobject: handle;

BEGIN;

BeginXtrd(0,300);

Rect(0,0,100,200);

EndXtrd;

hobject:=HDuplicate(LNewObj,0,400);

hobject:=HDuplicate(hobject,0,400);

END;

Run (ChangeThis1);

Next is code to create an object that inserts the above object then uses a document list to count the objects inside.

Procedure ChangeThis1;

VAR

Handobject: handle;

PIOHandle: handle;

PIOrecordhandle: handle;

PIOwallhandle: handle;

hobject: handle;

objectname: String;

i: integer;

PROCEDURE CreateObject(object2Create:String);

BEGIN;

objectname:=object2Create;

hobject:= CreateCustomObjectN(objectname,0,0,0,False);

Hmove(hobject,200,0);

END;

BEGIN;

CreateObject('03Extrudes');

i:=1;

HUngroup(hobject);

DoMenuTextByName('Convert to Group',2);

SymbolToGroup(hobject,1);

Handobject:=FIngroup(hobject);

WHILE Handobject <> NIL DO BEGIN

i:=i+1;

Handobject:=NextObj(Handobject);

END;

message(i);

END;

Run (ChangeThis1);

Can't get access at all

Link to comment

I just spent a little time fooling with your script and couldn't access 'Convert To Group' either.

I could get the script to place a PIO, group it using ('Group Chunk',1) and count the one PIO inside it....

The appendix says that the selector is 'Convert to Group Chunk' but that didn't seem to work with any index. Thing is, it's not part of a chunk. If it's part of any chunk it would be the Convert chunk, but all the other Convert commands are not part of any chunk and would be called like ('Convert to Lines',0)

And it didn't work as simply ('Convert to Group',0) either.

I didn't work with it that long, so maybe I'm missing something but it does look a little bug-like.

This kinda illustrates why DMTBN isn't recommended. Custom workspaces and changes to workspaces made in product updates can break the script.

What I keep wondering is why you don't make this simple PIO a procedure in the parent that takes the needed parameters, rather than taking on the whole child/parent thing.

Of course, I've no idea where you're headed with this.

Guess I'm not much of a family guy.

Link to comment

Thank for trying Charles.

What we are doing is complex:

There are 20-30 components in the PIO that make up a part.

The assembly of the component is a straight forward stack. Each component has a size. The height of the last component is simply all the previous ones thickness added. But height is not the only location consideration. Object shift in all 3Ds as the final part is created. Add in complexity that some objects rotate which affects clipping of other objects, Then add a the ability to give components options, ie this part is timber or aluminum, and you quickly get a significant number of objects to manage.

The parent child method allows breaking up of the code into discrete object. This is very useful. First it allows for simple testing of the component parts before they get introduced to the larger model. Second the division allows for more than one person to work on the bigger project, as multiple people can script the parts.

The clip tool is a straight forward, yet complex, shape. The shape stays the same but changes scale on each clip. Currently we have the clip shape hardcoded into each component. This is okay for now, but if any change is required to the clip shape, then there is an expanding list of scripts to cut and paste the clip procedures. (thank you bbEdit for your mulit search you may be called on soon)

My aim with my last few posts is to be able to ring fence the cliping object in one pio. No luck so far.

Link to comment
  • 1 month later...

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...