오토캐드 vba로 스트레치 명령 사용해 보기 stretch
캐드로 스트래치를 마음대로 조절할 수만 있다면 수많은 작업을 편하게 하지 않을까 싶어서 많이 찾아보고 있는데,
이런 정보가 있어서 함께 공유합니다.
함수를 하나 만드는 방법 1번,
Public Sub StretchEntity()
Dim ss As AcadSelectionSet
Set ss = ThisDrawing.SelectionSets.Add("MySS")
ss.Select acSelectionSetAll
Dim ent As AcadEntity
Dim line As AcadLine
For Each ent In ss
If TypeOf ent Is AcadLine Then
Set line = ent
StretchLine line
End If
Next
ss.Delete
End Sub
Private Sub StretchLine(line As AcadLine)
Dim pt As Variant
Dim basePt As Variant
basePt = line.StartPoint
pt = ThisDrawing.Utility.GetPoint(basePt, vbCr & "Stretch the line's end point to:")
line.EndPoint = pt
line.Update
End Sub
명령어창을 이용하는 방법도 있네요. 2번째 해법...
Public Sub testStretch()
' keep left button when specify other corner
Dim comm As String
comm = "_stretch _c pause "
ThisDrawing.SendCommand comm
End Sub
실전에서 사용할 수 있도록 더 노력해야 겠네요.
'Etc' 카테고리의 다른 글
11월 13일부터 시작되는 마스크 데이 "마스크 꼭 쓰세요"…위반하면 최대 10만원 과태료 부과합니다. (0) | 2020.11.13 |
---|---|
일체 유심조, 나의 철학이 되다... 궁금한 이야기 y가 세상에 널리 알려준다. (0) | 2020.03.01 |
오토캐드 dxf파일 저장 후 열려고 하면 에러가 나는 경우 취할 행동 (0) | 2019.12.17 |
엘리베이터 제작에 들어가는 산세강판(PO)에 대해 알아보자 (0) | 2019.12.13 |
엘리베이터에 사용하는 철판 CR이 뭔지.... (0) | 2019.12.13 |