šŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.cad.autocad
Article #401

ARX-Centerlines and Arcs???

#401
From: Jacob
Date: Tue, 25 Apr 2000 00:00
155 lines
4128 bytes
What is the code for me, if I want to make a certain linetype (centerline)
and an Arc?
Here is an example of how I make certain polylines, and Iļæ½m expecting
something like that:
***********************************************
AcDbObjectId

createDrawLilleSt()
{
 ifstream in;
 in.open("c:\\test2.txt");
 double X1=0,Y1=0,Z1=0;
 double X2,Y2,Z2;
 double X3,Y3,Z3;
 double X4,Y4,Z4;
 double X5,Y5,Z5;
 double X6,Y6,Z6;
 double X7,Y7,Z7;
 double X8,Y8,Z8;
 double X9,Y9,Z9;
 double X10,Y10,Z10;
 double H1;
 double L1;
 double T;

 file://Fileparametres to read
 in>>H1>>L1>>T;

 Left side
 X1=T;
 Y1=(H1-T)-(L1/3);
 Z1=0;

 X2=X1+(L1/3);
 Y2=Y1+(L1/3);
 Z2=Z1;

 X3=X2-T;
 Y3=Y2;
 Z3=Z2;

 X4=X1;
 Y4=Y1+T;
 Z4=Z3;

 X5=X4;
 Y5=Y4+T;
 Z5=Z4;

 Right side
 X6=0+L1-T;
 Y6=0+(H1-T)-(L1/3);
 Z6=Z5;

 X7=X6-(L1/3);
 Y7=Y6+(L1/3);
 Z7=Z1;

 X8=X7+T;
 Y8=Y7;
 Z8=Z7;

 X9=X6;
 Y9=Y6+T;
 Z9=Z8;

 X10=X9;
 Y10=Y9-T;
 Z10=Z9;



 in.close();

 AcGePoint3d startPt(X1,Y1,Z1);
  AcGePoint3d endPt(X2,Y2,Z2);
  AcDbLine *pLine = new AcDbLine(startPt, endPt);

 AcGePoint3d startPt2(X2,Y2,Z2);
  AcGePoint3d endPt2(X3,Y3,Z3);
  AcDbLine *pLine2 = new AcDbLine(startPt2, endPt2);

 AcGePoint3d startPt3(X3,Y3,Z3);
  AcGePoint3d endPt3(X4,Y4,Z4);
  AcDbLine *pLine3 = new AcDbLine(startPt3, endPt3);

 AcGePoint3d startPt4(X4,Y4,Z4);
  AcGePoint3d endPt4(X5,Y5,Z5);
  AcDbLine *pLine4 = new AcDbLine(startPt4, endPt4);

 AcGePoint3d startPt5(X6,Y6,Z6);
  AcGePoint3d endPt5(X7,Y7,Z7);
  AcDbLine *pLine5 = new AcDbLine(startPt5, endPt5);

 AcGePoint3d startPt6(X7,Y7,Z7);
  AcGePoint3d endPt6(X8,Y8,Z8);
  AcDbLine *pLine6 = new AcDbLine(startPt6, endPt6);

 AcGePoint3d startPt7(X8,Y8,Z8);
  AcGePoint3d endPt7(X9,Y9,Z9);
  AcDbLine *pLine7 = new AcDbLine(startPt7, endPt7);

 AcGePoint3d startPt8(X9,Y9,Z9);
  AcGePoint3d endPt8(X10,Y10,Z10);
  AcDbLine *pLine8 = new AcDbLine(startPt8, endPt8);


 AcDbBlockTable *pBlockTable;
  acdbHostApplicationServices()->workingDatabase()
   ->getSymbolTable (pBlockTable, AcDb::kForRead);

 AcDbBlockTableRecord *pBlockTableRecord;
  pBlockTable->getAt (ACDB_MODEL_SPACE, pBlockTableRecord,
   AcDb::kForWrite);

  pBlockTable->close();

  AcDbObjectId lineId;
  pBlockTableRecord->appendAcDbEntity(lineId, pLine);
 pBlockTableRecord->appendAcDbEntity(lineId, pLine2);
 pBlockTableRecord->appendAcDbEntity(lineId, pLine3);
 pBlockTableRecord->appendAcDbEntity(lineId, pLine4);
 pBlockTableRecord->appendAcDbEntity(lineId, pLine5);
 pBlockTableRecord->appendAcDbEntity(lineId, pLine6);
 pBlockTableRecord->appendAcDbEntity(lineId, pLine7);
 pBlockTableRecord->appendAcDbEntity(lineId, pLine8);

 pBlockTableRecord->close();
 pLine->close();
 pLine2->close();
 pLine3->close();
 pLine4->close();
 pLine5->close();
 pLine6->close();
 pLine7->close();
 pLine8->close();


 return lineId;

}

--
***********************************************
Regards
Jacob Abildgaard
Stud. Polyt.
Aalborg University - DK
Email (personal): gokker@bitsmart.com
Email (work)     : xjz@kmd.dk
Phone: +45-40829082
Fax: +44-8701303616
Homepage: http://gokker.bizland.com
ICQ: 57361162
**********************************************
Technical Details
Message-ID: <3TbN4.5504$mB3.28415@twister.sunsite.auc.dk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 109d22,8a0a91173a7858da,start
X-Google-Attributes: gid109d22,public
X-Google-Thread: 10e889,8a0a91173a7858da,start
X-Google-Attributes: gid10e889,public
X-Google-Thread: 10af0b,8a0a91173a7858da,start
X-Google-Attributes: gid10af0b,public
From: "Jacob" <gokkerNOSPAM@bitsmart.com>
Subject: ARX-Centerlines and Arcs???
Date: 2000/04/25
Message-ID: <3TbN4.5504$mB3.28415@twister.sunsite.auc.dk>
X-Deja-AN: 615342825
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-Trace: twister.sunsite.auc.dk 956647999 130.225.59.7 (Tue, 25 Apr 2000 09:33:19 MET DST)
Organization: "SunSITE Denmark -- sunsite.auc.dk
X-MSMail-Priority: Normal
NNTP-Posting-Date: Tue, 25 Apr 2000 09:33:19 MET DST
Newsgroups: comp.cad.autocad,dk.edb.cad,dk.edb.programmering.c