.NET

Reply
Valued Contributor
Ertqwa
Posts: 99
Registered: ‎10-03-2011
Message 1 of 3 (250 Views)
Accepted Solution

WblockCloneObjects - bool deferTranslation

250 Views, 2 Replies
12-20-2011 01:49 PM

Hello,

 

I am using WblockCloneObjects, but I don't understand what the last parameter does:

 

bool deferTranslation - Controls if object ids should be translated.

 

What does it do? When should it be TRUE and when should it be FALSE? Can anyone explain or point me in the right direction?

 

Thanks

Hi,

 

The ObjectARX documentation (arxdoc.chm) explains this under the "AcDbDatabase::wblockCloneObjects" method :

 

I quote :

 

"When the objects to be cloned do not all have the same owner, then it is necessary to make up individual AcDbObjectIdArray entities, each one containing all the objects with the same owner. The wblockCloneObjects() method is then called once for each array, with the deferXlation argument set to true for all but the last call, so that ID translation will be done to complete the cloning."

 

So, when you are using the wblockCloneObjects to clone objects that do not belong to the same owner, then it is better to defer the translation until all the grouped objects (belonging to the same owner) have been clones by separate calls to "wblockCloneObjects". The last call to the wblockCloneObjects will then set the "deferTranslation" to false to carry out the translation phase. During the translation phase, new objectId is provided for each of the clone objects and the IdMap becomes useful.

 

 

ADN Support Specialist
Balaji_Ram
Posts: 733
Registered: ‎03-21-2011
Message 2 of 3 (210 Views)

Re: WblockCloneObjects - bool deferTranslation

12-26-2011 08:15 PM in reply to: Ertqwa

Hi,

 

The ObjectARX documentation (arxdoc.chm) explains this under the "AcDbDatabase::wblockCloneObjects" method :

 

I quote :

 

"When the objects to be cloned do not all have the same owner, then it is necessary to make up individual AcDbObjectIdArray entities, each one containing all the objects with the same owner. The wblockCloneObjects() method is then called once for each array, with the deferXlation argument set to true for all but the last call, so that ID translation will be done to complete the cloning."

 

So, when you are using the wblockCloneObjects to clone objects that do not belong to the same owner, then it is better to defer the translation until all the grouped objects (belonging to the same owner) have been clones by separate calls to "wblockCloneObjects". The last call to the wblockCloneObjects will then set the "deferTranslation" to false to carry out the translation phase. During the translation phase, new objectId is provided for each of the clone objects and the IdMap becomes useful.

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 3 of 3 (202 Views)

Re: WblockCloneObjects - bool deferTranslation

12-26-2011 10:47 PM in reply to: Balaji_Ram

Sorry for offt-opic, Balaji

Here is a situation with one file where is two identical linetypes

with the same name and SHX

So this drawing won't to be copied using WBlockCloneObjects method

Purge, audit,recovery and rewriting this drawing as dxf format -

all is with no luck

How to avoid this trouble?

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!