Quick tip: Setting start values for drawing object handles

<?xml encoding=”UTF-8″>By Gopinath Taget

If you would like entity handle values of entities to start from a specific value, you can use the AcDbDatabase::setHandseed() method. The following code forces handle values to start at 1000.

Note that setting Handseed to a value less than the largest handle in the drawing will prevent entities being added to that drawing and serious problems could occur. To get the current available handle, you can use the AcDbDatabase::handseed method.

<div><p><span><font face="Consolas"><font color="#000000">AcDbDatabase * pDb = acdbHostApplicationServices()->workingDatabase();</font></font></span></p><p><span><font face="Consolas"><font color="#000000">AcDbHandle hand(1000);</font></font></span></p><p><span><font face="Consolas"><font color="#000000">Acad::ErrorStatus es = pDb->setHandseed(hand);</font></font></span></p></div>

Comments

One response to “Quick tip: Setting start values for drawing object handles”

  1. Thanks for this blog I have gotten some points here. Recently I’m doing my research related to this.

Leave a Reply to Montalto GlazeCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading