Chuyển đến nội dung
Diễn đàn CADViet
Đăng nhập để thực hiện theo  
hatieu

Nhờ viết hộ lisp vẽ composite panel

Các bài được khuyến nghị

Em muốn vẽ composite panel mầu sắc và kích thước như hình vẽ (composite panel.dwg đính kèm composite panel)

Quá trình thực hiện lệnh (giống như file sheet.lisp đính kèm sheet.lsp).

1-Gõ lệnh comp

2-Nhập chiều dày mặc định là 4mm

3-Pick điểm đầu->điểm tiếp theo...

4-Pick vào bên nào thì nó sẽ vẽ về bên đó.

Thanks! Mong sự giúp đỡ của các anh.

Chia sẻ bài đăng này


Liên kết tới bài đăng
Chia sẻ trên các trang web khác

Chưa ai giúp em à!

Em có lisp này nhưng chỉ thực hiện được phần nhỏ của công việc trên.Anh xem có phát triển lên được như ý ban đầu của em không

;;; *********** Radian to Degree Conversion **************
(defun rtd (a) (/ (* a 180.0) pi))
;***********************************************
(defun c:direc()
	(graphscr)
	(setvar "blipmode" 1)
	(setq sp1 (getpoint "\nStart point : "))
	(setq om (getvar "orthomode"))
	(setvar "orthomode" 1)
	(setq sp2 (getpoint sp1 "\nEnd point : "))
	(command "line" sp1 sp2 "" )

	(setq l_direc (angle sp1 sp2))
	(setq sp1x (car sp1 )
		  sp1y (cadr sp1 )
		  sp2x (car sp2 )
		  sp2y (cadr sp2 ))
	(command "ucsicon" "off")
	(command "ucs" "o" sp1)
	(command "ucs" "z" (rtd l_direc))

	(setq lp (getpoint "\nSide to drawing: "))
	(command "erase" "l" "" )
	(setvar "orthomode" om)
	(setvar "blipmode" 0)
	(setq lpx (car lp )
		  lpy (cadr lp ))
	(command "ucs" "")
	(command "ucsicon" "on")


	(if (> lpy 0)
			(setq direc (+ l_direc (* 0.5 pi)))
			(setq direc (- l_direc (* 0.5 pi)))
	)
	(setq l_direc1 l_direc
		  l_direc2 (+ l_direc  pi))
)
;******************************************************************
;***************************Uget1**********************************
;******************************************************************
(defun uget1 (msg def)	  ;getreal
	(prompt (strcat "\n" msg "<" (rtos def)))
		(setq w (getstring ">: "))
		(if (/= "" w) (atof w) def)
   )
;******************************************************************
;******************** composite panel drawing ************************
;******************************************************************
(defun c:comp2()
	(COMMAND "UCS" "W")
	(SETQ t1 (UGET1"Composite panel thikness " 4.0))   ;defualt 4
	(setvar "cmdecho" 0)
	(c:direc)
	(setvar "blipmode" 0)
	(setq osm (getvar "osmode"))
	(setvar "osmode" 0)
	(setq skin (/ t1 8)
		  sp3 (polar sp1 direc skin)
		  sp4 (polar sp2 direc skin)
		  sp5 (polar sp1 direc (- t1 skin))
		  sp6 (polar sp2 direc (- t1 skin))
		  sp7 (polar sp1 direc t1 )
		  sp8 (polar sp2 direc t1)
	)
	(setq culr (getvar "clayer"))
  (command "layer" "m" "composite" "c" "3" "" "") 
	(command "layer" "s" "composite" "" "")
	(command "pline" sp1 sp7 sp8 sp2 "c" )
  (command "layer" "s" "composite" "" "")
	(command "COLOR" "1" "")
(command "linetype" "s" "continous"  ""  "")
	(command "line" sp3 sp4 "" )
	(command "line" sp5 sp6 "" )
	(command "layer" "s" culr "")
	(setvar "cmdecho" 0)
	(setvar "blipmode" 1)
	(setvar "osmode" osm)
	(princ)
)

Chia sẻ bài đăng này


Liên kết tới bài đăng
Chia sẻ trên các trang web khác

Phù....!!!!Vẽ nhiều composite panel mệt quá, mà vẫn chưa tìm ra giải pháp. Rất mong các bác giúp.

Đây là em sưu tầm được trên mạng. Nhưng vẫn chưa theo ý của em.Cái khó nhất là chỗ góc lượn. :lol:

(defun c:ppp (/ e1 a th ir e2 e3 e4 e5 e6 p1 p2 p3 p4 osn ofr oecho oerr)
 (vl-load-com)

 (setq oerr *error*)
 (defun *error* (msg)
(princ "\n ERROR! 
")
(setvar "filletrad" ofr)
(setvar "cmdecho" oecho)
(setvar "osmode" osn)
(setq *error* oerr)
(command)
(princ)
 )

 (princ "\n Draw Face Of Panel Profile : ")
 (command "._pline")
 (while (= 1 (getvar "CMDACTIVE"))
(command PAUSE)
 )
 (setq	e1 (entlast)
a  (getpoint "\n Pick A Point On The Interior Side Of The Panel : ")
th (/ (getdist "\n Input The Panel Thickness: ") 2)
ir (+ th 0.03125)
osn (getvar "osmode")
ofr (getvar "filletrad")
oecho (getvar "cmdecho")
 )
 (setvar "filletrad" (+ th 0.03125))
 (setvar "osmode" 8)
 (setvar "cmdecho" 0)
 (command "offset" th e1 a "")
 (setq e2 (entlast))
 (command "erase" e1 "")
 (command "fillet" "p" "l")
 (princ "\n Pick A Point On The Exterior Side Of The Panel: ")
 (command "offset" th e2 pause "")
 (setq e3 (entlast))
 (princ "\n Pick A Point On The Interior Side Of The Panel: ")
 (command "offset" th e2 pause "")
 (setq e4 (entlast))
 (command "erase" e2 "")
 (setq p1 (vlax-curve-getStartPoint e3)
p2 (vlax-curve-getStartPoint e4)
p3 (vlax-curve-getEndPoint e3)
p4 (vlax-curve-getEndPoint e4))
 (command "line" p1 p2 "")
 (setq e5 (entlast))
 (command "line" p3 p4 "")
 (setq e6 (entlast))
 (command "pedit" e3 "j" e4 e5 e6 "" "")
 (setvar "osmode" osn)
 (setvar "filletrad" ofr)
 (setvar "cmdecho" oecho)

 (princ)
)

 

Em muốn thực hiện vẽ được như theo bản vẽ bên dưới.

File Composite panel.dwg

 

1_20.jpg

2_11.jpg

Chia sẻ bài đăng này


Liên kết tới bài đăng
Chia sẻ trên các trang web khác

Tạo một tài khoản hoặc đăng nhập để nhận xét

Bạn cần phải là một thành viên để lại một bình luận

Tạo tài khoản

Đăng ký một tài khoản mới trong cộng đồng của chúng tôi. Điều đó dễ mà.

Đăng ký tài khoản mới

Đăng nhập

Bạn có sẵn sàng để tạo một tài khoản ? Đăng nhập tại đây.

Đăng nhập ngay
Đăng nhập để thực hiện theo  

×