The DataCAD Developer Network (DDN) is an online resource for information and support for DCAL® (DataCAD Applications Language) developers as well as anyone interested in creating fonts, toolbars, hatch patterns, or linetypes for use in DataCAD.
#27546 by joshhuggins
Wed Aug 29, 2007 5:14 pm
I am trying to write a toolbar code to update all of a drawings GTV's to their extents and sets the selected scale, but have hit a wall. Here is what I have so far.

Here is the beginning of the code that loads the scl file, sets the scales and updates the first two GTV's. The red highlights show the selection of each GTV.
=^:^F0^F4^F1^F7^Architectural.scl$^:^F2^F1^/^F2^:^S5^F4^F9^v^S6^F1^F2^/^F2^:^S5^F4^F9^v^S6^F2^

As it reaches the end of each "page" of GTV's I added a S2 Scroll FWRD to the strings.
Access Second Page of GTV's
^S2^F1^/^F2^:^S5^F4^F9^v^S6^S2^F1^S2^F2^/^F2^:^S5^F4^F9^v^S6^S2^F2^
Access Third Page of GTV's
^S2^S2^F1^/^F2^:^S5^F4^F9^v^S6^S2^S2^F1^S2^F2^/^F2^:^S5^F4^F9^v^S6^S2^S2^F2^

This works really good and so fast.... until..... My question is, is there a way that when a code reaches a point where when a button does not exist because say it has reached the end of the GTV list in this example, that the code stops running? I have repeated this series of strings so that it updates 50 GTV's. The problem is when it get to the point where there are no more GTV's and the last page does not have 10 GTV's to create the S2 Scroll Fwrd button it keeps running the code and messes up the last set of GTV's. If by chance the last page of GTV's is an even 10, it keeps running the program on the last set of GTV's which doesn't mess up the GTV's because the GTV's are in the same order, but it still takes time to run through the unneeded GTV updates. If there was a way for it to realize that the button called is not there, and to stop the code, would be good. If it could jump to a new section of code would be even better, but doubt it right? I'm sure this is probably something that is beyond a toolbar code and probably should be done in DCAL by the "uber-gurus" but I thought I'd ask just in case someone has an idea. Thanks for any help and would really like to try to get this to work as it works very very well upto the last page of GTV's.
Image

Who is online

Users browsing this forum: No registered users and 7 guests

About DataCAD Forum

The DataCAD Forum is a FREE online community we provide to enhance your experience with DataCAD.

We hope you'll visit often to get answers, share ideas, and interact with other DataCAD users around the world.

DataCAD

Software for Architects Since 1984