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.
#11438 by Jsosnowski
Tue May 09, 2006 11:51 am
D4D: Programmers Wishlist. Contribute ideas for modifications, new features and limitations in the DataCad / macro interface.
#11523 by Jsosnowski
Fri May 12, 2006 3:14 pm
Continuing a list from a another thread "DCAL Limitations".

Increasingly, as I work on program design, I find the need for several accomodations from DataCad.

:arrow: I frequently encounter conditions where it would be desirable to display items composed of various entities as if they were combined as a single entity. This object must be recognized and treated as a single object by Datacad including display, plotting, editing etc... Considering Delphi is an OOPs environment it appears possible that such objects might be defined as child classes to a base parent class of a Datacad entity container class methods to respond to meesages from Datacad notifying it of actions such as add, delete, move, copy, stretch etc... This would also imply that DataCad must be able to identify the managing program from each entity (using a specifical attribute name?) and invoke the program when needed to manage override methods or action message responses. Another alternative might be to allow the independent programs to remain active in a sperate thread where they could montor for messages and determine the appropriate action to take.
#29599 by Jsosnowski
Thu Oct 25, 2007 1:44 pm
Several follow-up issues from DCAL Limitations

:arrow: The ability to open and close files with a running macro is still important. Project information is rarely contained in a single document and some means of updating information between files would be nice. I can use a file to store update information for use in separate drawings, but the user must manually open each and start the macro. It would be much easier and more effective if this exchange could be automated. Would it be possible to provide a means for a macro to open another drawing file and invoke itself in the new running file stack? Instructions between running macros could be handled by messages. I have not dug too deep into Windows messaging yet, but I assume that means that Datacad must pass messages to the macro expanding the "Main" procedure and "State" types.

:arrow: Xrefs. Although I can make changes in Xrefs by adjusting their attributes, How can I generate a new one? Access to an Xref dialog would help, but it would would be better if the macro could provide input as well. This is similar to the problem with managing hatching through DCAL The only oiption appears to be invoking a user dialog to generate a hatch pattern. It would be nice if the macro could set-up the field information and generate the hatch pattern without user input. I am more interested in access to Xrefs than hatching however.
#29600 by Jsosnowski
Thu Oct 25, 2007 3:42 pm
Re: XRefs in previous post:

I had forgotten that Devinder had addressed this issue. Xrefs are a super polyline and the data to set it up is handled through attibutes. I examined the attributes for an X Ref and got a few problem readings. The "atr" macro fails to idntify the type of attribute for several attribute fields and returns nonsense values. For example, DC-File has no type and returns a value of 384. Similarly I am getting confusingtypes or values for DC-Xclip Min & Max and DC-Clip000. I assume that DC-file is a string with either a relative or complete path. The meanings of the other three are not clear without values to demostrate how they are used. Are there anyother attribute names, I have found 10 associated with xRefs.
#29636 by devinder
Fri Oct 26, 2007 8:30 am
A new type of field was added to attributes in DataCAD 11 which atr macro (or any old DCAL macro) does not understand. X-Refs mostly use this type of field to store Data and that is why you see garbage Data. The type index of this attribute should be 8, in case you are interested and stores 255 byte long data.
DC-XCLIP_MIN and DC-XCLIP_MAX are attributes of point type.
DC-XCLIP000 , DC-XCLIP001, DC-XCLIP002 and so on stores X-Clip polyline data. Each attribute here is capable of storing upto 15 points.
#29641 by Jsosnowski
Fri Oct 26, 2007 8:58 am
Is there any macro code to manage these new attribute types or possibly arevise macro ? Adapting to a str255 is not a problem. How are point attributes handled? As a point with x,y,z fields? For clip cubes is each atribute a polyvert with a max of 15 (000 through 014)? What is XRef-Min & Max vs. DC-ClipMain & Max? I thought that an Xref is brought in to another drawing to its full extents and that clip cubes modify the extent shown so I'm not sure how to manipulate them. An example of code handling the attributes would help if it is available.

Thanks again for your help.
#29650 by devinder
Fri Oct 26, 2007 10:44 am
Using Delphi DCAL or older DCAL?
#29658 by Jsosnowski
Fri Oct 26, 2007 12:25 pm
Either is fine, D4D is preferable. A source sample showing how you are reading the attributes would be helpful.
#29665 by devinder
Fri Oct 26, 2007 1:17 pm
Code: Select all   TXClipPointsRec = packed record
                  case byte of
                     1 : (sz : Byte;
                          npnts : Byte;
                          Pnts  : array [1..15] of point2d);
                     0 : (str : str255);
               End;

procedure ShowXClipsPoints(ent : entity);
var
  idx : integer;
  atr : attrib;
  prec : TXClipPointsRec ;
  PntCnt : integer;
begin
   idx := 0;
  PntCnt := 0;
   While true do
   begin
      atr.name := Format('DC-XCLIP%.3d',[Idx]);
      inc(idx);
      if atr_find(ent.frstatr, atr.name, atr) then
      begin
         PRec.str := atr.shstr; //not available in old DCAL
         For i := 1 to PRec.npnts do
         begin
            inc(PntCnt);
            Showmessage(Format('Point_%.3d  x=%f, y=%f',[PntCnt,PRec.pnts[i].x,PRec.pnts[i].y]));
         end;
      end else
         break;
   end;
end;


NOTE: Code not tested, but this is the concept
#29675 by Jsosnowski
Fri Oct 26, 2007 3:01 pm
Thanks!

I reviewed the field declarations for attrib in D4d and do not see atr.shstr Were you refering to atr.str255?
#29676 by devinder
Fri Oct 26, 2007 3:05 pm
Yes, The field variable is shstr of type str255 of attrib record.
Code: Select allatr_str255: (shstr: str255);
#29677 by Jsosnowski
Fri Oct 26, 2007 3:09 pm
oops. Thanks, I guess I can't read on Friday afternoons!

Who is online

Users browsing this forum: No registered users and 21 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