How to get base point of block in a .3dm file

I am developing a plugin that import block from .3dm and support setting position with mouse via api GetPoint.
But when adding block definition using api InstanceDefinitionTable.Add, need “Point3d basePoint”, and i can’t get it from .3dm.

imported file is below, and it is nested block
WallBoxCylinder.3dm (84.8 KB)

The base point of an instance definition is always the world origin (e.g. 0,0,0).

– Dale

In UI, creating a new block need to set a base point which can be anywhere.

If you insert 3dm file (FileToImport.3dm) into your file as a new block instance by UI, base-point of new block is World coordinates origin (0,0,0) from FileToImport.3dm file.
Your new block instance contains nested blocks and they are available in your new fie, you can insert them using UI by _Insert command and select block definition name from available blocks. By doing so, and selecting insert point as origin (0,0,0), base point of just newly inserted block will be in the origin.

The Block command transforms all selected geometry to the world origin. The newly created instance definition references the transformed geoemtry.

– Dale

Is it possible to store base point of block when save block to a .3dm file? If that, we can import block and set insert point dynamically via getpoint in one step; otherwise, user should import block to world origin and then move it to wanted position.

You can define the insert point as a Description property, and retrieve it later when needed.