Page 1 of 1

PostPosted: Fri Aug 25, 2006 11:25 am
by devinder
An untested example :wink:
Code: Select allvar
   laddr : lyraddr;
   ent  : entity;
begin
   ent_init(ent, entcrc);
   ent.color := 15;{any color index from 1 to 255}
   ent.crcrad := 3 * onefoot; { 3 foot radius}
   {Circles center is initialized at 0,0,0 with base and height at 0. Change other paramters}
   ent_add(ent);
 { All entities gets added to current layer}
   if lyr_find('Layer2Find',laddr) then
   begin
     if not lyr_islocked(laddr) then
     begin { programmer should make sure layer is not locked otherwise entity will not update}
         ent.layer := laddr;
         ent_update(ent);
      end;
   end;
end;

PostPosted: Sat Aug 26, 2006 8:09 pm
by devinder
My mistake too. All entities gets added with current state parameters, i.e. color/linetype/spacing/etc when ent_add is called. DCAL users can only update entities after it has been added to the database. Try the following.
Code: Select allent_init(ent,entmrk);  //init point (marker) "entity" type
ent.mrktyp:=1;
  pnt.x:=...
  pnt.y:=...
  pnt.z:=...
ent.mrkpnt:=pnt;
if ent_add(ent) then
begin
   ent.color := 15; {Set new color}
   ent_update(ent);
   ent_draw(ent,drmode_white);  //complete entity creation
end;

MrkSiz is not a valid parameter of point and not used to draw the point, and should not be part of DataCAD entity.
Only following Mrktypes are valid:
0,1 -> Square type like reference points.
2 -> Cross like symbol insertions
3 -> Diamonds like bezier/bspline
4 -> Dot on screen
5 -> Square ,large size
6 -> cross, large size

Anything else is not defined and will not draw anything.