New Development Article
Monsen
Administrator 🖼️ 81 images Cartographer
I've just posted my second article in my XP development series.
I know this is a bit too technical for some of you, but I still hope it is useful.
You can check out the series.
I know this is a bit too technical for some of you, but I still hope it is useful.
You can check out the series.
Comments
//comments//
myself so the reader wouldn't have to flip back and forth) this blog was very useful for understanding entities and how they work. Of particular interest to me was how easily the third and fifth examples could be adapted to import/export map notes from/to text files. If the next blog could cover file input and output operations for XPs that would be great. Also is there a more efficient way of locating particular entities than "walking the drawing list" and testing the contents of each? (This would include anySELBY1
picking from the XP.)If you are looking for a particular entity, you'll have to walk the drawing list (as long as you can stick to testing for type, like I do in the examples, the operation is reasonably cheap), but when you are dealing with selections, you can always just use the DLS_Sel flag in DLScan to have it returned selected entities only.
I was hoping to use the CC3+ file dialogs for opening and closing the notes files, but if not how do I get the current drawing name/path so I can import/export drawing notes from/to a text file with the same name in the same directory with the extension ".notes"? (Fortunately I found some good C++ tutorials online since I'm a bit rusty in that language.)
I'm not exactly clear on how to do this. How do I set up the RDATA entry to select single or multiple entities to process?
I'll talk about RDATA more in a later installment of the series, but basically, to use a selection, set up RDATA like this:
For the data type, you can either use
RD_Pick
for a regular selection, orRD_Pick1
which selects just one entity. Note thatRD_Pick
obeys the current select method, so it may or may not prompt the user to make a selection, depending on that setting.Now, if you used
RD_Pick
, you need to walk the drawing list, using theDLS_Std|DLS_Sel
flags. This will only return entities that was part of the selection. If you usedRD_Pick1
, the selected entity is never really selected, but you get a reference to the entity record returned to the ent variable instead, no need to access the drawing list.GETDWGNAME
macro command) so I can at least open the file dialog the current drawing's path. Or if there is a simpler way to get the CC3+ data directory path than opening and reading the "@.ini
" file in the installation directory.