FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CadPythonShell/Script Examples/ironpython2.7/createARC.py at dev · chuongmep/CadPythonShell · GitHub
chuongmep
/
CadPythonShell
Public
Notifications
You must be signed in to change notification settings
Fork
23
Star
119
Code
Issues
3
Pull requests
0
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
CadPythonShell
/
Script Examples
/
ironpython2.7
/
createARC.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (32 loc) · 1.03 KB
Breadcrumbs
CadPythonShell
/
Script Examples
/
ironpython2.7
/
createARC.py
Copy path
File metadata and controls
32 lines (32 loc) · 1.03 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#Copyright(c) 2021, Hồ Văn Chương
# @chuongmep, https://chuongmep.com/
import
clr
import
sys
sys
.
path
.
append
(
'C:\Program Files (x86)\IronPython 2.7\Lib'
)
import
os
import
math
clr
.
AddReference
(
'acmgd'
)
clr
.
AddReference
(
'acdbmgd'
)
clr
.
AddReference
(
'accoremgd'
)
# Import references from AutoCAD
from
Autodesk
.
AutoCAD
.
Runtime
import
*
from
Autodesk
.
AutoCAD
.
ApplicationServices
import
*
from
Autodesk
.
AutoCAD
.
EditorInput
import
*
from
Autodesk
.
AutoCAD
.
DatabaseServices
import
*
from
Autodesk
.
AutoCAD
.
Geometry
import
*
doc
=
Application
.
DocumentManager
.
MdiActiveDocument
ed
=
doc
.
Editor
db
=
doc
.
Database
#Code Here :
with
doc
.
LockDocument
():
with
doc
.
Database
as
db
:
with
db
.
TransactionManager
.
StartTransaction
()
as
t
:
bt
=
t
.
GetObject
(
db
.
BlockTableId
,
OpenMode
.
ForRead
)
btr
=
t
.
GetObject
(
bt
[
BlockTableRecord
.
ModelSpace
],
OpenMode
.
ForWrite
)
centerPt
=
Point3d
(
0
,
0
,
0
)
radius
=
50
arc
=
Arc
(
centerPt
,
Vector3d
.
ZAxis
,
radius
,
0
,
math
.
pi
/
2
)
btr
.
AppendEntity
(
arc
)
t
.
AddNewlyCreatedDBObject
(
arc
,
True
)
t
.
Commit
()
print
(
"Arc Created"
)
Back
|
FazBrowse Home
|
New Git URL