Thông tin Admin |
Quản trị: Nguyễn Anh Tuấn
Email: Ctythanhgia@gmail.com
Điệnthoại: 0914.524.611
|
Latest topics | » Nội Qui Sử Dụng Diễn Đàn Thành GiaSat Feb 10, 2024 12:34 pm by phuvanhoancke@gmail.com» Tâm linh gia đình: Cách Lau Dọn Bàn Thờ Thần Tài để hòa mình vào tài lộcSat Jan 13, 2024 2:18 pm by banthothantai999» Chinh phục định mệnh, rinh ngay quà đỉnh cùng NOVA88Fri Dec 29, 2023 7:29 pm by bongphui» Mách bạn: Cách đặt Bàn Thờ Thần Tài cho cửa hàng phát đạtFri Dec 29, 2023 2:59 pm by banthothantai999» Hòa mình vào thế giới E-Sports cùng NOVA88 - Nhận ngay tiền thưởngWed Dec 27, 2023 4:15 pm by bongphui» Hòa mình vào thế giới E-Sports cùng NOVA88 - Nhận ngay tiền thưởngWed Dec 27, 2023 4:15 pm by bongphui» Rinh ngay phần thưởng Giáng Sinh hàng ngày - Tham gia NOVA88 ngayMon Dec 25, 2023 5:03 pm by bongphui» Chinh phục Số Tám may mắn, nhận thưởng đại phát cùng NOVA88Fri Dec 22, 2023 4:52 pm by bongphui» NOVA88 thử thách dự đoán tỷ số Inter MilanTue Dec 19, 2023 4:00 pm by bongphui» Chào mừng sân chơi thể thao - Đăng ký NOVA88 nhận ngay tiền thưởngSat Dec 16, 2023 11:04 am by bongphui |
Từ điển online |
|
Poll | | Bạn đang dùng phần mềm dự toán nào? | Dự toán Acitt | | 18% | [ 111 ] | Dự toán 97 | | 34% | [ 215 ] | Dự toán G8 | | 15% | [ 95 ] | Dự toán Escon | | 3% | [ 18 ] | Dự toán Delta | | 6% | [ 37 ] | Dự toán Hitosoft | | 15% | [ 95 ] | Dự toán GXD | | 9% | [ 54 ] |
| Tổng số bầu chọn : 625 |
|
Statistics | Diễn Đàn hiện có 6216 thành viên Chúng ta cùng chào mừng thành viên mới đăng ký: manhcuongxdbd
Tổng số bài viết đã gửi vào diễn đàn là 4250 in 3735 subjects
|
Social bookmarking |
Bookmark and share the address of on your social bookmarking website |
|
April 2024 | Mon | Tue | Wed | Thu | Fri | Sat | Sun |
---|
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 | | | | | | Calendar |
|
1> | | Lisp rải đối tượng theo đường dẩn | |
| | Tác giả | Thông điệp |
---|
Admin Admin
Giới tính : Tổng số bài gửi : 864 Sinh nhật : 09/04/1981 Ngày tham gia : 13/08/2011 Tuổi : 43 Việc làm/sở thích : Tư vấn thiết kế, giám sát thi công, quản lý dự án...
| Tiêu đề: Lisp rải đối tượng theo đường dẩn Fri Jun 08, 2012 9:56 pm | |
| - Code:
-
(Defun c:rdt (/ ss doituong dsl dc ddd chondd chieudaicuver diemdau diemcuoi krai chieudaidoan slc sl index d2 p2 d5 p5 d3 p3 dt l m) (vl-load-com) (command "undo" "be") (command "ucs" "") (chonnhomdoituong) (choncuver) (hoikieurai) (command "ucs" "p") (command "undo" "end") (princ) ) ;;;;;;;;;;;;;;;;; (Defun c:dtd (/ ss doituong dsl dc ddd chondd chieudaicuver diemdau diemcuoi krai chieudaidoan slc sl index d2 p2 d5 p5 d3 p3 dt l m daidendiem) (vl-load-com) (command "undo" "be") (command "ucs" "") (choncuver) (cdxuatphatdo) (cdketthucdo) (Cond ((< daidendiemdo daidenhuongdo) (setq chieudaidoan (- daidenhuongdo daidendiemdo))) ((> daidendiemdo daidenhuongdo) (setq chieudaidoan (- daidendiemdo daidenhuongdo))) ) (command "undo" "end") (princ (strcat "\nChieu dai doan do la: " (rtos chieudaidoan 2 4))) (princ) ) ;;;;;;;;;;;;;;;;; (Defun c:rtd (/ ss doituong dsl dc ddd chondd chieudaicuver diemdau diemcuoi krai chieudaidoan slc sl index d2 p2 d5 p5 d3 p3 dt l m daidendiem) (vl-load-com) (command "undo" "be") (command "ucs" "") (chonnhomdoituong) (choncuver) (chondiemxuatphat) (hoikieuraicd) (command "ucs" "p") (command "undo" "end") (princ) ) ;;;;;;;;;;;;;;;;; (Defun dotructiep () (cdxuatphatdo) (cdketthucdo) (Cond ((< daidendiemdo daidenhuongdo) (setq chieudaidoan (- daidenhuongdo daidendiemdo))) ((> daidendiemdo daidenhuongdo) (setq chieudaidoan (- daidendiemdo daidenhuongdo))) ) (princ) ) ;;;;;;;;;;;;;;;;; (Defun cdxuatphatdo () (setq luubatdiem (getvar "osmode")) (setvar "osmode" 545) (setq diemchuando (getpoint "\nTu diem <tren duong dan>:")) (setvar "osmode" 0) (setq daidendiemdo (vlax-curve-getDistAtPoint chondd diemchuando)) (setvar "osmode"luubatdiem) (cond ((= daidendiemdo nil) (princ "\nDiem vua chon khong nam tren duong dan, chon lai:") (cdxuatphatdo)) ((/= daidendiemdo nil))) (princ) ) ;;;;;;;;;;;;;;;;; (Defun cdketthucdo () (setq luubatdiem (getvar "osmode")) (setvar "osmode" 545) (setq diemdinhhuongdo (getpoint diemchuando"\nDen diem <tren duong dan>:")) (setvar "osmode" 0) (setq daidenhuongdo (vlax-curve-getDistAtPoint chondd diemdinhhuongdo)) (setvar "osmode"luubatdiem) (cond ((= daidenhuongdo nil) (princ "\nDiem vua chon khong nam tren duong dan, chon lai:") (cdketthucdo)) ((/= daidenhuongdo nil))) (princ) ) ;;;;;;;;;;;;;;;;; (Defun cdxuatphat () (setq luubatdiem (getvar "osmode")) (setvar "osmode" 545) (setq diemchuan (getpoint "\nDiem bat dau rai tren duong dan:")) (setvar "osmode" 0) (setq daidendiem (vlax-curve-getDistAtPoint chondd diemchuan)) (setvar "osmode"luubatdiem) (cond ((= daidendiem nil) (princ "\nDiem vua chon khong nam tren duong dan, chon lai:") (cdxuatphat)) ((/= daidendiem nil))) (princ) ) ;;;;;;;;;;;;;;;;; (Defun cdketthuc () (setq luubatdiem (getvar "osmode")) (setvar "osmode" 545) (setq diemdinhhuong (getpoint diemchuan"\nDiem ket thuc rai tren duong dan:")) (setvar "osmode" 0) (setq daidenhuong (vlax-curve-getDistAtPoint chondd diemdinhhuong)) (setvar "osmode"luubatdiem) (cond ((= daidenhuong nil) (princ "\nDiem vua chon khong nam tren duong dan, chon lai:") (cdketthuc)) ((/= daidenhuong nil))) (princ) ) ;;;;;;;;;;;;;;;;; (Defun thongbaoketqua () (princ (strcat "\nChieu dai doan la: " (rtos chieudaitinh 2 4) doanhienthinoidung)) (princ) ) ;;;;;;;;;;;;;;;;; (Defun chondiemxuatphat () (cdxuatphat) (cdketthuc) (Cond ((< daidendiem daidenhuong) (setq chieudaitinh (- daidenhuong daidendiem)) (setq dautinh +)) ((> daidendiem daidenhuong) (setq chieudaitinh (- daidendiem daidenhuong)) (setq dautinh -)) ) (setq doanxuatphat daidendiem) (princ) ) ;;;;;;;;;;;;;;;;; (Defun hoikieuraicd () (setq kraicd (strcase (getstring "\nKieu rai theo: Tinh /So luong/<Khoang cach>")))
(Cond ((= kraicd "T") (raisoluongtinh)) ((/= kraicd "T") (Cond ((= kraicd "S") (raisoluongcd)) ((/= kraicd "S") (raikhoangcachcd)) ) ) ) (princ) ) ;;;;;;;;;;;;;; (Defun raisoluongtinh () (setq slrai (getreal "\nRai them may lan khong tinh doi tuong tai diem bat dau rai:")) (setq chieudaidoan (GETDIST "\nKhoang cach 1 lan rai: <Nhap 0 de do tren duong dan>")) (Cond ((= chieudaidoan 0) (dotructiep)))
(setq tongdoan (* slrai chieudaidoan)) (Cond ((> tongdoan chieudaitinh) (princ (strcat "\nChieu dai doan la: " (rtos chieudaitinh 2 4) ", Yeu cau la: " (rtos chieudaidoan 2 4) "x" (rtos slrai 2 0) "=" (rtos tongdoan 2 4))) (princ "\nVuot qua chieu dai cho phep, nhap lai:") (raisoluongtinh)) ((< tongdoan chieudaitinh) (setq sl (fix (+ slrai 1))) (setq sl (fix sl)) (setq doanhienthinoidung (strcat "\nDa thuc hien rai: " (rtos slrai 2 0) " lan voi khoang cach " (rtos chieudaidoan 2 4))) (thuchienrai) ) ) (princ) ) ;;;;;;;;;;;;;; (Defun raikhoangcachcd () (setq chieudaidoan (GETDIST "\nKhoang cach 1 lan rai: <Nhap 0 de do tren duong dan>")) (Cond ((= chieudaidoan 0) (dotructiep))) (Cond ((> chieudaidoan chieudaitinh) (princ (strcat "\nChieu dai doan la: " (rtos chieudaitinh 2 4) ", Yeu cau la: " (rtos chieudaidoan 2 4))) (princ "\nVuot qua chieu dai cho phep, nhap lai:") (raikhoangcachcd)) ((< chieudaidoan chieudaitinh) (setq sol (+ (/ chieudaitinh chieudaidoan) 1)) (setq sl (fix sol)) (setq sl (fix sl)) (setq doanhienthinoidung (strcat "\nDa thuc hien rai: " (rtos sol 2 0) " lan voi khoang cach " (rtos chieudaidoan 2 4))) (thuchienrai) ) ) (princ) ) ;;;;;;;;;;;;;; (Defun raisoluongcd () (setq slc (getreal "\nChia duong dan thanh may lan:")) (setq chieudaidoan (/ chieudaitinh slc)) (setq sl (fix (+ 1 slc))) (setq doanhienthinoidung (strcat "\nDa thuc hien rai: " (rtos slc 2 0) " lan voi khoang cach " (rtos chieudaidoan 2 4))) (thuchienrai) (princ) ) ;;;;;;;;;;;;;; (Defun chonnhomdoituong () (princ "\nChon doi tuong rai:") (setq ss (ssget))
(cond ((= ss nil) (princ "\nChua chon duoc doi tuong nao:") (chonnhomdoituong)) ((/= ss nil) (setq dsl (sslength ss)) (cond ((= dsl 1) (setq doituong (ssname SS 0)) (setq doituong (entget doituong)) (setq KIEUDOITUONG (cdr (assoc 0 doituong))) (cond ((= KIEUDOITUONG "INSERT") (setq dc (cdr (assoc 10 doituong)))) ((/= KIEUDOITUONG "INSERT") (chondiemchuandoituong)) );ketthuccondxemblock );kethucdsl1 ((/= dsl 1) (chondiemchuandoituong)) );ketthuccondnho
);ketthucsetqdsl );ketthuccondtong (princ) ) ;;;;;;;;;;;;;;;;; (Defun chondiemchuandoituong () (setq dc (getpoint "\nChon diem goc: ")) (cond ((= dc nil) (princ "\nChua chon duoc diem goc:") (chondiemchuandoituong)) ((/= ss nil))) (princ) ) ;;;;;;;;;;;;;;;;; (Defun choncuver ()
(setq ddd (entsel "\nChon duong dan:")) (while (or (null ddd) (or (= "TEXT" (cdr (assoc 0 (entget (car ddd))))) (= "MTEXT" (cdr (assoc 0 (entget (car ddd))))) (= "HATCH" (cdr (assoc 0 (entget (car ddd))))) (= "INSERT" (cdr (assoc 0 (entget (car ddd))))) (= "REGION" (cdr (assoc 0 (entget (car ddd))))) (= "DIMENSION" (cdr (assoc 0 (entget (car ddd))))) ) ) (setq ddd (entsel "\nDoi tuong khong the lam duong dan! Chon lai")) )
(setq chondd (car ddd)) (setq luubatdiem (getvar "osmode")) (setvar "osmode" 0) (setq chieudaicuver (vlax-curve-getDistAtParam chondd (vlax-curve-getEndParam chondd))) (setq doanxuatphat 0) (setvar "osmode"luubatdiem) (princ) ) ;;;;;;;;;;;;;;;;; (Defun hoikieurai () (setq dautinh +) (setq krai (strcase (getstring "\nKieu rai theo: So luong/<Khoang cach>"))) (Cond ((= krai "S") (raisoluong)) ((/= krai "S")(raikhoangcach)) )
(princ) ) ;;;;;;;;;;;;;; (Defun raikhoangcach () (setq chieudaidoan (GETDIST "\nKhoang cach doan chia: ")) (setq sol (+ (/ chieudaicuver chieudaidoan) 1)) (setq sl (fix sol)) (setq sl (fix sl)) (thuchienrai) (princ) ) ;;;;;;;;;;;;;; (Defun raisoluong () (setq slc (getreal "\nChia duong dan thanh may lan:")) (setq chieudaidoan (/ chieudaicuver slc)) (setq sl (fix (+ 1 slc))) (thuchienrai) (princ) ) ;;;;;;;;;;;;;; (Defun thuchienrai (/ quaykhong)
(setq quaykhong (strcase (getstring "\nCo quay doi tuong vuong goc voi duong dan khong: Khong/<Co>"))) (Cond ((= quaykhong "K") (setq copygiua copykoquay)) ((/= quaykhong "K")(setq copygiua copyquay)) )
(setq index -1)
(repeat sl (setq index (1+ index)) (setq d2 (dautinh doanxuatphat (* chieudaidoan index))) (setq luubatdiem (getvar "osmode")) (setvar "osmode" 0) (setq p2 (vlax-curve-getPointAtDist chondd d2)) (setvar "osmode"luubatdiem) (copygiua) ) (thongbaoketqua) (princ) ) ;;;;;;;;;;;;;;;;;;;;;;;; (defun copycuoiquay() (setq luubatdiem (getvar "osmode")) (setvar "osmode" 0) (setq d5 (- (dautinh doanxuatphat (* chieudaidoan index)) 0.01)) (setq p5 (vlax-curve-getPointAtDist chondd d5)) (setq L 0) (setq M (sslength ss)) (while (< L M) (setq DT (ssname ss L)) (command ".copy" DT "" dc p2) (command ".rotate" "last" "" p2 p5) (command ".rotate" "last" "" p2 180) (setq L (1+ L)) ) (setvar "osmode"luubatdiem) (princ) ) ;;;;;;;;;;;;;;;;;;;;;;;; (defun COPYQUAY(/ p3) (setq luubatdiem (getvar "osmode")) (setvar "osmode" 0) (setq d3 (+ (dautinh doanxuatphat (* chieudaidoan index)) 0.001)) (setq p3 (vlax-curve-getPointAtDist chondd d3)) (setvar "osmode"luubatdiem) (Cond ((= p3 nil) (copycuoiquay)) ((/= p3 nil) (setq L 0) (setq M (sslength ss)) (setq luubatdiem (getvar "osmode")) (setvar "osmode" 0) (while (< L M) (setq DT (ssname ss L)) (command ".copy" DT "" dc p2) (command ".rotate" "last" "" p2 p3) (setq L (1+ L)) ) (setvar "osmode"luubatdiem) ) )
(princ) ) ;;;;;;;;;;;;;;;;;;;;;;;; (defun COPYKOQUAY() (setq luubatdiem (getvar "osmode")) (setvar "osmode" 0) (command ".copy" ss "" dc p2 "") (setvar "osmode"luubatdiem) (princ) ) ;;;;;;;;;;;;;; (Defun c:vdd ()
(setq ddd (entsel "\nChon duong dan:")) (while (or (null ddd) (or (= "TEXT" (cdr (assoc 0 (entget (car ddd))))) (= "MTEXT" (cdr (assoc 0 (entget (car ddd))))) (= "HATCH" (cdr (assoc 0 (entget (car ddd))))) (= "INSERT" (cdr (assoc 0 (entget (car ddd))))) (= "REGION" (cdr (assoc 0 (entget (car ddd))))) (= "DIMENSION" (cdr (assoc 0 (entget (car ddd))))) ) ) (setq ddd (entsel "\nDoi tuong khong the lam duong dan! Chon lai")) )
(setq chondd (car ddd)) (setq L (vlax-curve-getDistAtParam chondd (vlax-curve-getEndParam chondd))) (setq diemdau (vlax-curve-getPointAtDist chondd 0)) (setq diemcuoi (vlax-curve-getPointAtDist chondd l)) (setq dc (getpoint "\nChon diem goc: ")) (command ".line" dc diemcuoi "") (command ".line" dc diemdau "")
(princ) )
| |
| | | | Lisp rải đối tượng theo đường dẩn | |
|
Trang 1 trong tổng số 1 trang | |
Similar topics | |
|
| Permissions in this forum: | Bạn không có quyền trả lời bài viết
| |
| |
| Top posting users this week | |
Thống Kê | Hiện có 4 người đang truy cập Diễn Đàn, gồm: 0 Thành viên, 0 Thành viên ẩn danh và 4 Khách viếng thăm Không Số người truy cập cùng lúc nhiều nhất là 59 người, vào ngày Sun Jan 08, 2023 3:02 pm |
Trực tuyến |
var Tawk_API = Tawk_API || {}, Tawk_LoadStart = new Date ();
(chức năng(){
var s1 = document.createElement ("script"), s0 = document.getElementsByTagName ("script") [0];
s1.async = true;
s1.src = 'https: //embed.tawk.to/5fc31231920fc91564cba3e3/default';
s1.charset = 'UTF-8';
s1.setAttribute ('crossorigin', '*');
s0.parentNode.insertBefore (s1, s0);
}) ();
|
|