Please help-us,
We need sample-file-drawing.dwg, where you execute your lisp.script
in this mode the helpers@swamp.com avoid UCS issues, UCSName reject script/s.
So,you upload as version AutoCad2009, or AutoCAd2007 with saveAs-old-version.
before you upload here on the -swamp -forum.
Just over a week ago I posted on Cadtutor asking for help with modifying code from their forum.
Unfortunately I've had no replies.
I found many error/s inside yoursource.lisp
**1)You must check the entmakex failed, wtih the variable $rr and you compare
$rr with ent1.
or (setq doublecheck (entmakex (list (cons 0............)))
(if (and (/= ent1 $rr) (/= doublecheck nil))
(alert "EntMakex-doubleGood")
(alert "EntMakex-DoubleCheckFailed")
)
(if (/= ent1 $rr)
(alert "EntMakex-Good")
(alert "EntMakex-Failed")
)
**2)The revolve command are different in AutoCAD2021, AutoCad2010,
ZwCad,GstarCad.You ask and select type of Revolve
Now I did contact their Admin to ask if copying/modifying code from their site was OK before posting, the reply was yes.
**3)I recovery all math'equation/s for C++, C# compatibilty
23=#varname
24=var$ will be var24
/*c2s: rad23=angle(inpt,iang),
deg23=dh_rtd(rad23),
sb23=(hid23/2.0)-ikr23),
sc23= (idr23-ikr23),
sa223=((sc23*sc23)- (sb23*sb23)),
sa23=sqrt(sa223),
rad23a=(sb23/sc23),
a123=dh_rtd(rad23a),
a223=(360-a123);
ba23=list(-64.3743,-52.7755),
wsahelp=";part of lwpolyline bulge calculation";
pt01=polar(inpt,dh_dtr( (deg23+90)), (hid23/2)),
wsahelp=";from insertion point",
pt03=polar(pt01,dh_dtr( (deg23+0)),sflg23),
pt02=polar(inpt,dh_dtr( (deg23+270)), (hid23/2)),
wsahelp=";from insertion point",
pt04=polar(pt02,dh_dtr( (deg23+0)),sflg23),
pt05=polar(pt01,dh_dtr( (deg23+90)),hthk23),
pt07=polar(pt05,dh_dtr( (deg23+0)),sflg23),
pt06=polar(pt02,dh_dtr( (deg23+270)),hthk23),
pt08=polar(pt06,dh_dtr( (deg23+0)),sflg23),
pt09=polar(inpt,dh_dtr( (deg23+0)),sflg23),
cp01=polar(pt03,dh_dtr( (deg23+270)),ikr23),
cp02=polar(pt09,dh_dtr( (deg23+180)),sa23),
cp03=polar(pt04,dh_dtr( (deg23+90)),ikr23),
tp01=polar(cp01,dh_dtr( (deg23+a123)),ikr23),
tp03=polar(cp01,dh_dtr( (deg23+a123)), (ikr23+hthk23)),
tp02=polar(cp03,dh_dtr( (deg23+a223)),ikr23),
tp04=polar(cp03,dh_dtr( (deg23+a223)), (ikr23+hthk23)),
bf123=dh_etc( (dh_dtr(nth(0,ba23))/4)),
wsahelp=";bulge factor for curved lwpolylines",
bf223=dh_etc( (dh_dtr(nth(1,ba23))/4)),
wsahelp=";bulge factor for curved lwpolylines",
bf323=dh_etc( (dh_dtr(nth(0,ba23))/4)),
wsahelp=";bulge factor for curved lwpolylines",
bf423= (bf123*-1),bf523= (bf223*-1),bf623= (bf323*-1);
dh_oll("outside arc point/bulge list")
*/
/*c2s: hod24=dh_hod24,
wsahelp="hod24 is the main od",
hthk24=dh_hthk24,
wsahelp=";hthk23 is the wall thickness.",
sflg24=dh_sflg24,
wsahelp=";sflg24 is the flange straight length.",
hod23=distof(hod24,2),
hthk23=distof(hthk24,2),
sflg23=distof(sflg24,2),
hid23= (hod23- (hthk23*2)),
thkl24=dh_thkl24;
idr23= (hid23*0.9045),
wsahelp=";head rad\011\011; change these if require to get profile shape (* hid23 0.9045)",
ikr23= (hid23*0.1727),
wsahelp=";knuckle rad\011; change these if require to get profile shape (* hid23 0.1727)";
$rr=dh_cdh();
*/
/*c2s: dh_hod24="610.0",
dh_hthk24="12.7",
dh_sflg24="138",
inpt=getpoint("\nspecify insertion point of end cap: ");
iang=getpoint(inpt,"\ndrag cursor to select head orientation angle."),
inpt=trans(inpt,1,0),
iang=trans(iang,1,0);
dh_ssp();
*/
The left end cap (red) was created by the earlier lisp code by selecting the end point of the white line as the insertion point and the end of the vertical yellow line as the orientation point. The end cap is created as expected.
The Right hand (closed lwpolyline) shape was created by selecting the RH end point of the blue line as the insertion point and the LH endpoint of the same line as the orientation point.
**4) you must use (princ ..) after (entmakex......)
(setq $rr (entlast))
(setq doublecheck (entmakex (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (cons 90 (length vrt23)) (cons 70 1) (cons 10 pt01) (cons 42 0.0) (cons 10 pt05) (cons 42 0.0) (cons 10 pt07) (cons 42 bf123) (cons 10 tp03) (cons 42 bf223) (cons 10 tp04) (cons 42 bf323) (cons 10 pt08) (cons 42 0.0) (cons 10 pt06) (cons 42 0.0) (cons 10 pt02) (cons 42 0.0) (cons 10 pt04) (cons 42 bf623) (cons 10 tp02) (cons 42 bf523) (cons 10 tp01) (cons 42 bf423) (cons 10 pt03) (cons 42 0.0)))
(princ)
**5)
C:Q2=Why version AutoCad2007 of sample-file-drawing.dwg?
C:A2=Because old ProgeCad do not load a new version of Ac2021