Page 1 of 1

Usine D4D plvoid_add

PostPosted: Wed Mar 13, 2019 1:44 pm
by dhs
Is anybody able to give me some guidance on the use ff the plvoid_add procedure in D4D. I am trying to add a void to a polyline but the drawing crashes on the plvoid_add call.
The following is the logic I am using:
Code: Select all      plvoid_init (ent, newvoid);      // ent is the entity I am trying to add the void to.  newvoid is an entity
      polyvert_copy (voident.plnfrst, voident.plnlast, newvoid.plnfrst, newvoid.plnlast);   // voident is an existing polyline entity that I am using to define the void
      plvoid_add (ent, newvoid);

Debugger reports a memory violation: Project DCADWIN.exe raised exception class $C0000005 with message 'access violation ....

Immediately before the above logic voident has just been retrieved using ent_near with a point selected by the user (I have used the debugger to confirm that it is a valid pln entity). Ent was also retrieved using ent_near somewhat beforehand in the logic (and I have also confirmed that it is a valid pln entity). I tried adding an ent_get (ent, ent.addr) call immediately above the logic shown just in case DCAD thought it hadn't been loaded recently enough, but that made no difference ...

Am I doing something wrong in the way I am calling plvoid_add, and if so does anybody know what is the correct sequence of calls to use this procedure?

David H.