-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpoint.cpp
More file actions
42 lines (37 loc) · 958 Bytes
/
point.cpp
File metadata and controls
42 lines (37 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <iostream>
#include <cstdlib>
#include <fstream>
using namespace std;
int main()
{
double centerX, centerY;
cout<<"Enter X coordinate of point: ";
cin>>centerX;
cout<<"Enter Y coordinate of point: ";
cin>>centerY;
ofstream obj("entity.dxf");
obj<<"0\nSECTION\n2\nENTITIES\n0\nPOINT\n5\n43\n100\nAcDbEntity\n100\nAcDbPoint\n8\n0\n62\n256\n370\n-1\n6\nByLayer\n10\n"<<centerX<<"\n20\n"<<centerY<<"\n0\nENDSEC\n";
obj.close();
string line;
ofstream myfile("point.dxf");
ifstream head("header.dxf");
ifstream entity("entity.dxf");
ifstream foot("footer.dxf");
while(getline(head,line,'\n'))
{
myfile<<line<<"\n";
}
head.close();
while(getline(entity,line,'\n'))
{
myfile<<line<<"\n";
}
entity.close();
while(getline(foot,line,'\n'))
{
myfile<<line<<"\n";
}
foot.close();
myfile.close();
system("librecad point.dxf");
}