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

How to read a dst file?

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
913 Views, 4 Replies

How to read a dst file?

Hi
I want to search layout from a dst file,anyone has idea?
4 REPLIES 4
Message 2 of 5
_rhenley
in reply to: Anonymous

C:\Program Files\AutoCAD 2010\Help\acad_sso.chm
Message 3 of 5
Anonymous
in reply to: Anonymous

Thank you.
I have read the acad_sso.chm,but it look like for VBA, How ARX? Edited by: Y_Z_X on Jul 17, 2009 2:30 AM
Message 4 of 5
cadMeUp
in reply to: Anonymous

Yeah, you pretty much have to use COM to access the Sheet Set Manager API. Here is something that can get you started, pretty easy. I have this for AutoCAD/ObjectARX 2009:

1. Create a new ARX project with support for MFC.

2. Add this #import line to your StdAfx.h file, close to the bottom after the #include "arxHeaders.h" statement:
#import "acsmcomponents17.tlb" no_implementation raw_interfaces_only named_guids

(There is a 'acsmcomponents17.tlb' file located in your ARX distribution under 'inc-win32' or 'inc-x64', so make sure the #import statement can find it, though, if you have your paths set-up correctly for ARX in VS it should already be able to find it).

3. Add the code in the attached file to one of your command handlers. Build and test the project. If all goes well it should print out the name of the first sheet in the list with some basic info of the associated layout. Then it will print the names of the two subsets 'Architectural' and 'Structural'.

A couple of notes about the attached file, I added the #import statement (commented) to the top of the file for easy copy and paste. Also, ***important***, the sample is set to open the AutoCAD sample DST at:
C:\\Sample\Sheet Sets\Architectural\IRD Addition.dst

Make sure you change this line to the correct path:
CComBSTR dstPath("C:\\Autodesk\\AutoCAD MEP 2009\\Sample\\Sheet Sets\\Architectural\\IRD Addition.dst");

If you want to access sheets within subsets within subsets, you'll have to create some kind of recursive function to handle that scenario.

One other thing to be aware of:
AutoCAD/ObjectARX 2009 use 'acsmcomponents17.tlb'
AutoCAD/ObjectARX 2010 use 'acsmcomponents18.tlb'

I hope it works for you!
Message 5 of 5
Anonymous
in reply to: Anonymous

Thank you very much.

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

Post to forums  

Autodesk Design & Make Report

”Boost