ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get the Model_Space and Paper_Space blocks?

5 REPLIES 5
Reply
Message 1 of 6
alanchen123
614 Views, 5 Replies

How to get the Model_Space and Paper_Space blocks?

I am using RealDWG.

 

Based on Autodesk documents, each DWG file will contain a Model_Space block and a Paper_Space block. Then, how to get it via RealDWG?

 

Thanks

5 REPLIES 5
Message 2 of 6

Same as you would for any BlockTableRecord - open the BlockTable and access the BlockTableRecord from there. The ObjectARX Training labs posted to www.autodesk.com/developautocad and the ObjectARX sampels have code demonstrating this.

Cheers,

Stephen Preston
Autodesk Developer Network
Message 3 of 6

Should I use the name "*Model_Space" or lowercase name "*model_space" to get the block?
Message 4 of 6

You can use macro ACDB_MODEL_SPACE defined in acdb.h

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 5 of 6

It's easier to just use the SymbolUtilityServices class, which has a method that returns the ObjectId of the model space BlockTableRecord.

 

For a specific PaperSpace layout block, it can depend on whether you want the block for a specific layout given its name, as the block names for paper space layout blocks aren't really useful for much.

Message 6 of 6
maisoui
in reply to: alanchen123

Hi,

 

You should use this:

 

Acad::ErrorStatus es;
AcDbDatabase * pDatabase = acdbHostApplicationServices()->workingDatabase();
AcDbBlockTableRecordPointer pBlockTableRecord(ACDB_MODEL_SPACE, pDatabase, AcDb::kForRead); if((es = pBlockTableRecord.openStatus()) != Acad::eOk) return;

...

 

Regards,

Jonathan

 

--
Jonathan

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost