Block Object Ids order are modified when use command Insert as block

Hi,

I saw a change in the behaviour in Rhino 8 >= SR12.

I’m inserting a 3dm file as a block.
I insert 3 different files and when I repeat the insert for the first one, the order of the object ids is modified and the “last object” now is the “first one”.

Command: -_Insert
Name of block to insert ( File=No ): "Block_Pave_Black.3dm"
Insert as <Block> ( Block  Group  Objects ): _Block
Insertion point ( Rotate  Scale ): 0,0,0
Scale factor <1.000> ( ReferencePoint  XYZ  Rotate ): 1
Rotation angle <0.000> ( AxisAlign  ReferencePoint ): 0

Object Id: c53e387d-9daa-4a35-a363-2c54315e164e (THIS OBJECT END UP AS FIRST OBJECT)


Command: -_Insert
Name of block to insert ( File=No ): "Block_Pave_Orange.3dm"
Insert as <Block> ( Block  Group  Objects ): _Block
Insertion point ( Rotate  Scale ): 0,0,0
Scale factor <1.000> ( ReferencePoint  XYZ  Rotate ): 1
Rotation angle <0.000> ( AxisAlign  ReferencePoint ): 0

Object Id: 993e11e0-55a8-4fef-aedc-367f2e72e8ca
Object Id: c53e387d-9daa-4a35-a363-2c54315e164e


Command: -_Insert
Name of block to insert ( File=No ): "Block_Pave_Purple.3dm"
Insert as <Block> ( Block  Group  Objects ): _Block
Insertion point ( Rotate  Scale ): 0,0,0
Scale factor <1.000> ( ReferencePoint  XYZ  Rotate ): 1
Rotation angle <0.000> ( AxisAlign  ReferencePoint ): 0

Object Id: b5f4bbd8-8002-4b3c-976d-6b1e43490adc
Object Id: 993e11e0-55a8-4fef-aedc-367f2e72e8ca
Object Id: c53e387d-9daa-4a35-a363-2c54315e164e (HERE IS STILL THE LAST OBJECT AS IT IS EXPECTED)


Command: -_Insert
Name of block to insert ( File=No ): "Block_Pave_Black.3dm"
Insert as <Block> ( Block  Group  Objects ): _Block
Insertion point ( Rotate  Scale ): 0,0,0
Scale factor <1.000> ( ReferencePoint  XYZ  Rotate ): 1
Rotation angle <0.000> ( AxisAlign  ReferencePoint ): 0

Object Id: c53e387d-9daa-4a35-a363-2c54315e164e (HERE BECOME THE FIRST ONE)
Object Id: 49ccc9a1-1ba7-4edd-893c-049df24d73e4
Object Id: b5f4bbd8-8002-4b3c-976d-6b1e43490adc
Object Id: 993e11e0-55a8-4fef-aedc-367f2e72e8ca

I’m using this little script to print the ids in order:

Sub PrintAllObjectIds()
	Dim currentObjectId
	currentObjectId = Rhino.FirstObject()
	While currentObjectId <> ""
		Rhino.Print currentObjectId				
		currentObjectId = Rhino.NextObject(currentObjectId)		
	Wend
End Sub

Is this change in behaviour, expected? It is breaking my plugin.

Best regards,
Jordi

Hi @Jordi_Llonch,

Why are you counting on the order, which can change (as you have noticed)? Perhaps we need a bigger picture of what you’re doing?

– Dale

Hi Dale,

I count in the order because before inserting the 3dm files I get the first object id and after the import I iterate from the new first object until my previous object to know what are the new inserted objects.

I reported to Rhinoceros support (tech.eu@mcneel.co).

This is what I reported and the steps to reproduce:

Use this script and the 3dm files to reproduce what I told you. You will need to adjust the blocksPath variable.

Block_Pave_Black.3dm (48.0 KB)
Block_Pave_Orange.3dm (45.0 KB)
bug insert blocks.rvb (774 Bytes)

As you can see the first inserted block “78ad…” in the 3th iteration become the first object again where should be the last one.

Regards,
Jordi

Hi @Jordi_Llonch,

Best to use Rhino.LastCreatedObjects.

– Dale

Two similar topics withe same topic title:

HI @Jordi_Llonch ,

To close this thread, the bug you mentioned has already been fixed on our last build.

Kind regards,

Thanks!

RH-85134 is fixed in Rhino 8 Service Release 16