Jump to content
InfoFile
Tác giả: nguyentuyen6
Bài viết gốc: 109740
Tên lệnh: isb
Lisp thay thế các đường tròn bằng block
Mình cũng làm thử 1 cái,
cái này chọn circle nào thì no' insert lên circle đó


Filename: 109740_isb.lsp
Tác giả: Tot77
Bài viết gốc: 336866
Tên lệnh: dopl
Đo đường polyline

Sửa tạm cho bạn về việc thuận nghịch, còn những cái khác bạn bổ túc thêm.

(defun c:dopl(/ E LA OLDOS P1 P2 PT3)
(setq oldos (getvar "osmode"))
(setvar "osmode" 15359)
(setq la (getvar "clayer"))
(command "undo" "be")
(setq e (car (entsel "\n Chon polyline can do "))
        p1 (getpoint "\n Chon diem bat dau ")
        p2 (getpoint "\n Chon diem ket thuc ")
pt3 (getpoint "\n Chon diem dat ")
)
(tiep e p1 p2...
>>

Sửa tạm cho bạn về việc thuận nghịch, còn những cái khác bạn bổ túc thêm.

(defun c:dopl(/ E LA OLDOS P1 P2 PT3)
(setq oldos (getvar "osmode"))
(setvar "osmode" 15359)
(setq la (getvar "clayer"))
(command "undo" "be")
(setq e (car (entsel "\n Chon polyline can do "))
        p1 (getpoint "\n Chon diem bat dau ")
        p2 (getpoint "\n Chon diem ket thuc ")
pt3 (getpoint "\n Chon diem dat ")
)
(tiep e p1 p2 pt3) (setq p1 p2)
(while (setq p2 (getpoint "\n Chon diem ket thuc ")) 
(tiep e p1 p2 pt3) (setq p1 p2)
)
(command "undo" "e")
(setvar "osmode" oldos)
(princ)
)
 
(defun tiep (e p1 p2 pt3 / A1 A2 A3 E1 GOC H LA LEN P3 P4 P5 P6 P7 P8 PA1 PA2 PT1 V1 V2 V3)
(setq p1 (vlax-curve-getclosestpointto e p1)
p2 (vlax-curve-getclosestpointto e p2))
(setq pa1 (vlax-curve-getparamatpoint e p1)
        pa2 (vlax-curve-getparamatpoint e p2)
        v1 (vlax-curve-getfirstderiv e pa1)
        v2 (vlax-curve-getfirstderiv e pa2)
        len (- (vlax-curve-getdistatpoint e p2) (vlax-curve-getdistatpoint e p1))
 pt1 (vlax-curve-getClosestPointTo e pt3)
 h (distance pt3 pt1)
) 
  (setq a1 (atan (/ (cadr v1) (car v1)))
     a2 (atan (/ (cadr v2) (car v2)))
     p3 (polar p1 (+ a1 (/ pi 2)) h)
     p4 (polar p2 (+ a2 (/ pi 2)) h)
     p5 (polar p3 (+ a1 (/ pi 2))  (/ (* 0.5 h) h))
     p6 (polar p4 (+ a2 (/ pi 2))  (/ (* 0.5 h) h))
) 
(command "offset" h e "non" pt3 "")
(setq e1 (entlast)) 
  (command "break" e1 (if (> len 0) p4 p3) (vlax-curve-getendpoint e1))
(command "break" e1 (if (> len 0) p3 p4) (vlax-curve-getstartpoint e1))
(command "change" e1 "" "p" "la" la "")
(command "line" "non" p1 "non" p5 "")
(command "line" "non" p2 "non" p6 "")
(command "pline" "non" p3 "w" 0 0.25 "non" (polar p3 a1 0.75) "") 
(command "pline" "non" p4 "w" 0 0.25 "non" (polar p4 (+ a2 pi) 0.75) "")
 
(if (setq p7 (vlax-curve-getpointatdist e1 (/ (abs len) 2)))
(progn
(setq v3 (vlax-curve-getfirstderiv e1 (vlax-curve-getparamatpoint e1 p7))
a3 (atan (/ (cadr v3) (car v3)))
 goc (+ a3 (/ pi 2))
 p8 (polar p7 goc 0.5))
(command "text" "non" "J" "C" p8 1 (* 180 (+ a3 (/ pi 2))) (rtos (abs len) 2 2))
)
)
)

<<

Filename: 336866_dopl.lsp
Tác giả: Tot77
Bài viết gốc: 337198
Tên lệnh: rtd
[yêu cầu] Nhờ các bác viết lisp rải thép đai cho dầm

Thử cái này. Chú ý là cái đai (line) cần rải nằm ở điểm bắt đầu rải.

(defun c:rtd(/ ANG B1 B2 DIS DT LI OS P1 P2 TONG)
(defun chan(x n) (* n  (fix (/ x n 1.)) ))
(defun chia (a d1 d2 / D150 D200 DU)
(setq d200 (chan (* 0.5 a) d2)
d150 (chan (* 0.5 (- a d200 100)) d1)
du (* 0.5 (- a d200 (* 2 d150) 100)))
(list du d150 d200)
)
  (setvar 'cmdecho 0) 
(setq os (getvar 'osmode )
dt (car (entsel "\n Chon line de...
>>

Thử cái này. Chú ý là cái đai (line) cần rải nằm ở điểm bắt đầu rải.

(defun c:rtd(/ ANG B1 B2 DIS DT LI OS P1 P2 TONG)
(defun chan(x n) (* n  (fix (/ x n 1.)) ))
(defun chia (a d1 d2 / D150 D200 DU)
(setq d200 (chan (* 0.5 a) d2)
d150 (chan (* 0.5 (- a d200 100)) d1)
du (* 0.5 (- a d200 (* 2 d150) 100)))
(list du d150 d200)
)
  (setvar 'cmdecho 0) 
(setq os (getvar 'osmode )
dt (car (entsel "\n Chon line de rai:"))
p1 (getpoint "\n Rai tu diem dau:")
p2 (getpoint p1 "\n Den diem cuoi:") 
)
(setq b1 (getint (strcat "\n Buoc cua doan bien <" (if gl_b1 (itoa gl_b1) (itoa (setq gl_b1 150))) ">: ")))
(if b1 (setq gl_b1 b1))
(setq b2 (getint (strcat "\n Buoc cua doan giua <" (if gl_b2 (itoa gl_b2) (itoa (setq gl_b2 200))) ">: ")))
(if b2 (setq gl_b2 b2))
(setq dis (distance p1 p2)
ang (angle p1 p2)
li (chia dis gl_b1 gl_b2))
(setvar 'osmode 0)
(command "copy" dt "" p1 (polar p1 ang (setq tong 50)))
(command "copy" dt "" p1 (polar p1 ang (setq tong (+ tong (car li)))))
(repeat (/ (cadr li) gl_b1)
(command "copy" dt "" p1 (polar p1 ang (setq tong (+ tong gl_b1)))))
(repeat (/ (last li) gl_b2)
(command "copy" dt "" p1 (polar p1 ang (setq tong (+ tong gl_b2)))))
(repeat (/ (cadr li) gl_b1)
(command "copy" dt "" p1 (polar p1 ang (setq tong (+ tong gl_b1)))))
(command "copy" dt "" p1 (polar p1 ang (setq tong (+ tong (car li)))))
(command "copy" dt "" p1 (polar p1 ang (+ tong 50)))
(setvar 'cmdecho 1) (setvar 'osmode os) (princ)
)

<<

Filename: 337198_rtd.lsp
Tác giả: lamngoctien0810
Bài viết gốc: 336979
Tên lệnh: tg
[Nhờ sửa lisp] Đo tổng chiều dài đối tượng trên Autocad 2015

Bạn thay (command "lengthen" e_name "") bằng (command-s "lengthen" e_name "" "" "")

;; free lisp from cadviet.com
;;; this lisp was downloaded from http://www.cadviet.com/forum/topic/3778-lisp-tinh-tong-chieu-dai-cac-line-hay-pline/
(defun add_mline ()
(foreach e_record_sub e_record
(cond ((= 10 (car...
>>

Bạn thay (command "lengthen" e_name "") bằng (command-s "lengthen" e_name "" "" "")

;; free lisp from cadviet.com
;;; this lisp was downloaded from http://www.cadviet.com/forum/topic/3778-lisp-tinh-tong-chieu-dai-cac-line-hay-pline/
(defun add_mline ()
(foreach e_record_sub e_record
(cond ((= 10 (car e_record_sub))
(setq pt1 (cdr e_record_sub)
mline_len 0.0
)
)
((= 11 (car e_record_sub))
(setq pt2 (cdr e_record_sub)
mline_len (+ mline_len (distance pt2 pt1))
pt1 pt2
)
)
)
)
(setq tot_len (+ tot_len mline_len))
(ssdel e_name ss)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun C:tg (/ tot_len ss e_name e_record e_type)
(princ "\nCADViet.com © 2007")
(setq tot_len 0.0)
(setq ss (ssget))
(if (null ss)
(exit)
)
(while (> (sslength ss) 0)
(setq e_name (ssname ss 0))
(setq e_record (entget e_name))
(setq e_type (cdr (assoc '0 e_record)))
(cond ((wcmatch e_type "LINE,ARC,CIRCLE,POLYLINE,LWPOLYLINE,ELLIPSE,SPLINE")
(command-s "lengthen" e_name "")
(setq tot_len (+ tot_len (getvar "PERIMETER")))
(ssdel e_name ss)
)
((wcmatch e_type "MLINE") (add_mline))
(e_type (ssdel e_name ss))
)
)
(prompt (strcat "\nTotal length is: " (rtos tot_len 2 2)))
(princ)
)
(princ "\ntg - free lisp from www.cadviet.com")
(princ)

Thay không được bác à. vẫn đo 1 thằng thôi.

Command: TG
CADViet.com © 2007
Select objects: Specify opposite corner: 2 found
Select objects:
Current length: 500.0000
Specify total length or <500.0000>:
Select an object to change or : *Cancel*

<<

Filename: 336979_tg.lsp
Tác giả: lamngoctien0810
Bài viết gốc: 337354
Tên lệnh: cl
[Nhờ sửa lisp] Đo tổng chiều dài đối tượng trên Autocad 2015
switching from cymbalta to effexor xr emagrece “Tina and Amy decided to ask for the craziest package ever given to awards hosts. They are each being paid more than any Oscar host in history with the exception of Billy Crystal," a source told the gossip site comparing the ladies to the actor, who allegedly made close to $5 million for his hosting stint.
>>
switching from cymbalta to effexor xr emagrece “Tina and Amy decided to ask for the craziest package ever given to awards hosts. They are each being paid more than any Oscar host in history with the exception of Billy Crystal," a source told the gossip site comparing the ladies to the actor, who allegedly made close to $5 million for his hosting stint.
cymbalta 60 mg price hbo Generating advertising revenue has been one of Facebook’s greatest challenges. But after several missteps, the company has recently strengthened its advertising chops, especially for its mobile audience.
buy cymbalta online cheap skate The “reprehensible” stuff is a series of jokes in the premiere, Tuesday at 8 p.m., about Asians. First Eli and Warner force their Asian assistant Veronica (Brenda Song) to dress up and behave like a “sexy Asian schoolgirl” to reel in their Asian clients — Eli shows her how to do a teen-girl giggle. Later, we get the requisite Asian penis-size joke. And somewhere in there Veronica says to the guys, “You’re lucky your dads are American; my dad beat me with a math book till I was 16.”
how long does it take for cymbalta to work for back pain jumping Greece has seen a rise in anti-immigrant sentiments since its financial crisis. The director of the company sees the play as an opportunity to show people that there is no real difference between people.
cymbalta 120 mg dose a day Darvish had far less trouble, working his way through the Yankees" limp lineup with ease. The righthander had missed the past two weeks with a right trapezius strain, but he showed no sign of the injury while dominating the Yankees.
how to wean off cymbalta 30 mg posologie Separately, Democratic Senator Charles Schumer, who serves on the banking committee, on Wednesday urged President Barack Obama to nominate Federal Reserve Vice Chair Janet Yellen as the next chief of the U.S. central bank.
eli lilly cymbalta discount card legit Basic resources stocks were higher by 2.04 percent, after Tuesday"s promising data from China for August. Industrial output in the country rose 10.4 percent from a year ago, topping Reuters forecasts for a 9.9 percent rise. Meanwhile, retail sales and fixed asset investment both came in higher than expected.
cymbalta pain medication equivalents Since yesterday"s report on the suspension of the service, The Telegraph has heard from a number of anxious fundraisers whose money may have been lost. One asked: "Why didn"t the Charity Commission stop all donations as soon as they commenced their investigation?"
duloxetine 60 mg cap fass It did suggest, however, that while “the traditional travel agent is no longer necessary... specialised travel agents still exist to tackle unusual or exotic requests, usually from wealthy clients. They"ve created a niche that has turned a useless job into a profitable one.”
duloxetine hcl 30mg capsule illy To this gorgeous green base, I add protein: sprinkled roast seeds and nuts, or halved barely hard-boiled hen and quail eggs, slices of chorizo or bacon bits, leftover crabmeat or slivers of smoked salmon, crumbled feta or Parmesan, or peas and broad beans. For extra crunch, some croutons or pumpkin seeds maybe; for flavour, a few olives or artichoke hearts sott’olio. For sweetness, I add sliced pears and apples, or dried tomatoes or gherkins as a surprise.
eli lilly canada cymbalta quitting One of the sources close to the talks on Absheron saidRosneft could seek additional partnerships in Azerbaijan throughBP, the biggest foreign player in Azerbaijan and holder of a 20percent stake in Rosneft.
getting cymbalta cheap help paying The low yields suggest that investors view Jiangsu"sdirectly-issued bonds, which carry an explicit governmentguarantee, as much safer than debt issued by its LGFVs. Manytrust loans carry interest rates above 10 percent for one- ortwo-year loans.
duloxetine hydrochloride facial tic The Fed"s decision not to dial down its $85 billion in monthly government bond purchases — which are intended to hold down long-term interest rates — stunned financial markets. Fed Chairman Ben Bernanke had signaled since May that the Fed likely would soon reduce the bond-buying and end it by mid-2014 if the economy and job market continued to show improvement. Most economists surveyed by USA TODAY expected the tapering to begin in September.
cymbalta generic release date 2014 pga The New York-based Center for Constitutional Rights said the United States should not block Lady"s extradition to Italy just as it was seeking the return of former spy agency contractor Edward Snowden, who is charged with leaking information about secret U.S. surveillance programs.
generic cymbalta costco weight gainer BEIJING/HONG KONG - China reiterated its opposition on Thursday to a European Union plan to limit airline carbon dioxide emissions and called for talks to resolve the issue a day after its major airlines refused to pay any carbon costs under the new law.
opinioni su capsule per depressione cymbalta 30 mg toothache "A network that spends millions of dollars to spotlight Hillary Clinton, that"s a network with an obvious bias and that"s a network that won"t be hosting a single Republican primary debate," Priebus said on Friday. "We"re done putting up with this nonsense...The media overplayed their hand this time."
cymbalta cost 2014 egypt Chevedden says he doubts KBR would have acted without his prodding. Perhaps only someonewith his relentless focus could have come this far. When executives offer what he considers tobe poor compromises, he says: "I tell them, "good shouldn"t be the enemy of better.""
cymbalta testosterone levels pg/ml One of Raikkonen"s memorable Spa wins was with McLaren in 2004 in what was that team"s only victory of an otherwise barren year. His 2009 triumph for Ferrari was similarly face-saving as that team"s sole success of the year.
cymbalta duloxetine hcl european pharmacopoeia That was below a 6.3 percent rise in its third quarter dueto a strong comparative period but ahead of analyst forecasts.The firm said it was now on track to achieve "a slightly betteroutcome" before any exceptional items for the full year.
cymbalta cost help pms The iconic cream-filled sponge cake disappeared from the market after its maker, Hostess, went bankrupt eight months ago, having failed to reach a deal on a new contract with its striking bakers. Two investment firms — Apollo Global Management and C. Dean Metropoulos and Company — swooped down to purchase the company"s cake division (which includes Ho Hos and Ding Dongs) and launch a comeback.
cymbalta 120 mg fibromyalgia tattoo “The DPP will be undertaking a review of this case to determine what happened and to decide what action needs to be taken. We are now considering the involvement of this barrister in sexual-offence prosecutions and have advised his chambers that we will not instruct him in any ongoing or future cases involving sexual offences in the meantime.”
cymbalta 30 mg coupon hydrochloride capsules "The Group intends to exploit opportunities for buildingand/or acquiring assets all along the value chain, both upstreamand downstream, ranging from production assets such as orangegroves through processing assets," the company said, mentioningoilseed crushing plants and sugar refineries specifically.
stopping cymbalta 60 mg adversos The International Monetary Fund just downgraded its US growth forecasts. The largest economy on earth will expand 1.7pc this year, the Fund said last week in its World Economic Outlook, having predicted 1.9pc growth back in April. That’s sharply down from US growth of 2.2pc in 2012.
cymbalta dosage for nerve pain d&amp department Wells did not name anyone, but several former employees,including Noah Freeman, Jon Horvath, Donald Longueuil and WesleyWang, have already pleaded guilty to charges of criminal insidertrading. No criminal charges have been brought against Cohen.
60 mg cymbalta reviews starting dose For the past six months, the BBC has been investigating allegations of serious physical and sexual abuse at Fort Augustus Abbey School over a 30-year period. The programme contains testimony from victims, speaking openly for the first time about about their experiences at the hands of Benedictine monks.
how much does cymbalta cost 2012 gmc "What I want is all closed, or all open, but all equal.Otherwise it"s unfair competition," he said, complaining thatfurniture shops such as Ikea are allowed to be openSundays and sell tools such as drillers.
cymbalta 60 mg canada benefits Imagine the alternative reality in which the wolf pack makes a kill, but the cubs don"t wait their turn to get at that meat. Imagine if, instead of learning to eat what their parents eat, "kid" wolves ate heart, moon, star and clover-shaped multicolored marshmallows (or perhaps, being wolves, their marshmallows would be shaped like hare, moose, stag and caribou; but it"s the same general concept).
60 mg cymbalta high quality The fund"s performance turned positive in July as fears ofrising U.S. interest rates eased, helping Pimco"s overallexposure to U.S. Treasuries and government-related holdings. Thefund has roughly $262 billion in assets, according toMorningstar. Pimco, or Pacific Investment Management Co, is aunit of European financial services company Allianz SE, which had $1.97 trillion in assets as of June 30,according to the firm"s website.
order cymbalta 60 mg online pain relief Nobody knows quite how many thousands of girls are forced into marriage here — some say more than 50 percent of girls in the Muslim north — often sold for a bride price in mainly poor and rural communities.
duloxetine dr 60 mg cap wdi The drunken-driving charge "is the genesis of why we're here today," Franklin County Judge David Fais said. "Had Mr. Cordle not been driving that vehicle on that early morning under the influence, we wouldn't be here."
price of cymbalta 60 mg above The wild rugged dangerous and beautiful western states makes us appreciate just how difficult overcoming adversity was for those who went there over 100 years ago to get to the mild climate of the coast. Having lived in California myself for 5 years I"ve come to understand just how tame the east and places like most of overbuilt Europe are. We are nothing like you. You will never understand us.
generic cymbalta 2013 ncaa As for Russia, Snowden praised the country for being “the first to stand against human rights violations carried out by the powerful rather than the powerless.” It is no surprise that Snowden would pay tribute to the country processing his asylum request, but it is equally clear that this press conference was as much Putin’s as Snowden’s.
cymbalta duloxetine uk uxbridge Look on packaging for the Whole Grains Council seal or check the ingredients list for the words 100 percent whole wheat,  whole grain, whole wheat, oats, brown rice, or wheat berries. If the word “whole” is included in the first ingredient you know you are getting a whole grain product. If “whole” appears after the second ingredient then the product may only contain from one percent to 49 percent whole grains.
duloxetine 60 mg cost preo rj SEIU spokeswoman Cecille Isidro said the two sides hadessentially reached agreement on wages, pensions and healthcarecontributions, while work rules that the union says could leadto unsafe conditions remained the chief stumbling block. Shesaid she was not at liberty to elaborate. BART officials saidthe two sides were still in dispute over economic issues.
cymbalta 60 mg street price ai walgreens Most of the chemical agents are believed to be stored in territory under the control of forces loyal to President Bashar al Assad, who has pledged to ensure the safety of dozens of OPCW experts conducting verification activities in a war zone.
buy duloxetine the counter in uk Just being old is not everything. Mr Dauwalder pointed out the Victorian postal system wasn"t subject to competition from today"s phone calls or emails – hence stamps were issued in huge quantities. Also, there were fewer changes in design so issue sizes were huge.
cymbalta cost mfg The watchdog had faced opposition from companies and theaccounting sector"s regulator, the Financial Reporting Council,who has just introduced a rule requiring firms to considerretendering at least once a decade.
60 mg cymbalta high bijwerkingen “The press got all sorts of weird ideas about where he was living and the sort of security he was supposed to have, we read one report where he was supposed to have steel walls which we know for a fact wasn’t the case,” the landlady said. “He really had a very normal student life up there.”
generic cymbalta 2013 walmart pharmacy The Yankees said an outfielder will be called up Saturday; Alex Rodriguez is not going to be activated to fill the roster spot. Triple-A Scranton outfielders Melky Mesa and Thomas Neal are both reportedly going to be in Boston on Saturday, according to the Scranton Times-Tribune.
cymbalta 90 mg per day qhtd Pat Powers, the executive director of Matthew 25 Ministries, was a top youth racquetball coach. In the early 1990s he was convicted of sexual contact with 11 minors. As a born-again Christian, he says he is using his experience as a sex-offender to influence others.
weaning off cymbalta 60 mg to 30 mg vertigo Under the state law that created the emergency manager position, Detroit could not file for bankruptcy without the governor"s approval. Lawsuits by pension funds and city workers, filed earlier this month, had sought to prevent a filing. But on Thursday, Orr filed the bankruptcy petition, with Snyder"s permission, just minutes before Judge Aquilina was set to rule on a petition to stop the process.
cymbalta lawsuit phone number hdfc "The findings have important implications for the nature and timing of interventions aimed at preventing depression in the offspring of depressed mothers. In particular, the findings suggest that treating depression in pregnancy, irrespective of background, may be most effective," the scientists concluded.
cymbalta generic date available uottawa Canada"s starting goalie at the Winter Olympics will be determined by a number of factors and, given we still have three months to go before the momentous decision is reached, it figures the number of hideous, nightmarish goals scored on one of the candidates in head-to-head competition won"t move the needle one way or another.
cymbalta rxlist side effects The report concludes: "Whilst the promotion of arms exports and the upholding of human rights are both legitimate government policies, the government would do well to acknowledge that there is an inherent conflict between strongly promoting arms exports to authoritarian regimes whilst strongly criticising their lack of human rights at the same time, rather than claiming, as the government continues to do, that these two policies 'are mutually reinforcing'."

<<

Filename: 337354_cl.lsp
Tác giả: ruhungvang
Bài viết gốc: 337496
Tên lệnh: dai
Lisp tính tổng chiều dài một đối tượng

Em  có một lisp tính tổng chiều dài một đối lượng sau đó thay thế text chiều dài đó vào một đối tượng khác
Em muốn nhờ các bác sửa cho em một tí lisp này để bớt một bước

- Trong lisp này khi chọn đối tượng cần đo chiều dài xong nó có 2 yêu cầu 
" Ghi text mới...

>>

Em  có một lisp tính tổng chiều dài một đối lượng sau đó thay thế text chiều dài đó vào một đối tượng khác
Em muốn nhờ các bác sửa cho em một tí lisp này để bớt một bước

- Trong lisp này khi chọn đối tượng cần đo chiều dài xong nó có 2 yêu cầu 
" Ghi text mới <G> hay thay thế text <T> "
Em muốn bỏ bước này em muốn chọn thay thế luôn

- Em muốn sửa điều thứ 2 là : khi thay Text xong em muốn đổi màu text đó sang màu xanh luôn để phân bệt đc với các text giá trị khác

Em rất cảm ơn các bác

lisp đây ạ

(prompt "\nDe tinh chieu dai danh : dai")
(defun c:dai()
 (setvar "cmdecho" 0)
 (setq tong 0)
 (setq th (ssget))
 (setq index 0)
 (setq dtuong (sslength th))
 (while (< index dtuong)
  (setq ds (entget (ssname th index)))
     (command "lengthen" (ssname th index) "")
     (setq tong (+ tong (getvar "perimeter")))   
 (setq index (1+ index))
 )
 (print tong)
(prompt "Ghi text moi <G> hay thay the text (T) :")
(setq luachon (getstring))
(setq luachon (strcase luachon))
(if (= "" luachon) (setq luachon "G"))
(if (= "G" luachon)
 (progn
   (setq tong (rtos tong))
   (setq pt1 (getpoint))
   (setq h (/ (getvar "viewsize") 20))
   (command "text" pt1 h "" tong)
  )
 )
(if (= "T" luachon)
 (progn 
 (prompt "\n Chon gia tri can thay the")
 (SETQ TT (SSGET))
  (setq s (entget (SSNAME TT 0)))
  (setq otext (assoc 1 s))
  (setq ot (cdr otext))
  (setq ot (read (substr ot 1 )))
  (setq nt (cons 1 (rtos tong 2)))  
  (setq s (subst nt otext s))
  (entmod s)
 )
)
 
)

<<

Filename: 337496_dai.lsp
Tác giả: pphung183
Bài viết gốc: 337663
Tên lệnh: plvg
[Yêu cầu] Lisp vẽ polyline vuông góc bằng pick 2 điểm.
ウブロ 新作 8月 http://www.bestevance.com/fm/index.htm

Filename: 337663_plvg.lsp
Tác giả: quangnguyen50
Bài viết gốc: 337696
Tên lệnh: aas
Sh1NzT lllmqevhecdk, [url=http://frkqzhqahjbn.com/]frkqzhqahjbn[/url], [link=http://hojwedftwwed.com/]hojwedftwwed[/link], http://eyezrkjooyjy.com/

Filename: 337696_aas.lsp
Tác giả: Tue_NV
Bài viết gốc: 337722
Tên lệnh: tgpl
(Yêu cầu) Lisp tìm tất cả phần giao của polyline trong 1 polyline khác

Bác TrungNgaMy sử dụng Lisp này nhé:

(defun c:tgpl(/ e1 e2 Region lst-p lst-tam lst-line)
  (if (setq e1 (car (entsel "\n Chon PLINE 1 :")))
    (if (setq e2 (car (entsel "\n Chon PLINE 2 :")))
      (progn
            (setq Region (vlax-invoke (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object)))
                                               ...
>>

Bác TrungNgaMy sử dụng Lisp này nhé:

(defun c:tgpl(/ e1 e2 Region lst-p lst-tam lst-line)
  (if (setq e1 (car (entsel "\n Chon PLINE 1 :")))
    (if (setq e2 (car (entsel "\n Chon PLINE 2 :")))
      (progn
            (setq Region (vlax-invoke (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object)))
                                                  'addregion (list (vlax-ename->vla-object e1) (vlax-ename->vla-object e2)))
            )
            (vla-Boolean (car region) 1 (cadr region))
            (setq lst-line (vlax-invoke (vlax-ename->vla-object (entlast)) 'explode))
            (if (/= (cdr(assoc 0 (entget (entlast)))) "LINE")
                                    (setq lst-line (mapcar '(lambda(x) (vlax-invoke x 'explode)) lst-line))
            )
            (setq lst-p nil lst-tam nil)
            (if (null (eq (type (car lst-line)) 'LIST)) (setq lst-line (list lst-line)))
            (foreach x lst-line
              (foreach y x
                (setq lst-tam (append lst-tam (list (vlax-get y 'startpoint)(vlax-get y 'endpoint))))
                (vla-highlight y :vlax-true)
              )
              (setq lst-tam (Tue-list-removetrung lst-tam))
              (setq lst-p (append lst-p (list lst-tam)) lst-tam nil)
            )
     )
     )
   )
  lst-p
)
(defun Tue-list-removetrung (lst / lst1)
  (foreach x lst
      (if (not (member x lst1)) (setq lst1 (append lst1 (list x))))
      (Progn
              (foreach y lst1
                 (if (equal y x 1.0e-8)
                    (setq lst1 (vl-remove y lst1))
                 )
               )
                        (setq lst1 (append lst1 (list x)) )
       )
    )
  lst1
)

<<

Filename: 337722_tgpl.lsp
Tác giả: quangnguyen50
Bài viết gốc: 337759
Tên lệnh: jj joins
What sort of music do you like? zantac mg/ml The diminutive Romanian exploited some horrendous serving by Williams, who threw down seven double faults and won jus

Filename: 337759_jj_joins.lsp
Tác giả: Tot77
Bài viết gốc: 337839
Tên lệnh: dopl
[Nhờ sửa lisp] Đo đường polyline

Cái này chắc khá hơn.

(defun c:dopl(/ E LA OLDOS P1 P2 PT3)
(defun angf(d1 d2 ang) 
  (angle d1 (inters d1 (polar d1 ang 1) d2 (polar d2 (+ ang (* pi 0.5)) 1) nil))
)
(defun tiep (e p1 p2 pt3 / A1 A2 A3 E1 GOC H LA LEN P3 P4 P5 P6 P7 P8 PA1 PA2 PT1 V1 V2 V3)
(setq p1 (vlax-curve-getclosestpointto e p1)
p2 (vlax-curve-getclosestpointto e p2)
pa1 (vlax-curve-getparamatpoint e p1)
       pa2...
>>

Cái này chắc khá hơn.

(defun c:dopl(/ E LA OLDOS P1 P2 PT3)
(defun angf(d1 d2 ang) 
  (angle d1 (inters d1 (polar d1 ang 1) d2 (polar d2 (+ ang (* pi 0.5)) 1) nil))
)
(defun tiep (e p1 p2 pt3 / A1 A2 A3 E1 GOC H LA LEN P3 P4 P5 P6 P7 P8 PA1 PA2 PT1 V1 V2 V3)
(setq p1 (vlax-curve-getclosestpointto e p1)
p2 (vlax-curve-getclosestpointto e p2)
pa1 (vlax-curve-getparamatpoint e p1)
       pa2 (vlax-curve-getparamatpoint e p2)
       v1 (vlax-curve-getfirstderiv e pa1)
       v2 (vlax-curve-getfirstderiv e pa2)
       len (- (vlax-curve-getdistatpoint e p2) (vlax-curve-getdistatpoint e p1))
 pt1 (vlax-curve-getClosestPointTo e pt3)
 h (distance pt3 pt1)
 
a1 (atan (/ (cadr v1) (car v1)))
     a2 (atan (/ (cadr v2) (car v2)))
     p3 (polar p1 (angf pt1 pt3 (+ a1 (/ pi 2))) h)
     p4 (polar p2 (angf pt1 pt3 (+ a2 (/ pi 2))) h)
     p5 (polar p3 (angle p1 p3) 0.5)
     p6 (polar p4 (angle p2 p4) 0.5)
) 
(command "offset" h e "non" pt3 "")
(setq e1 (entlast)) 
(command "break" e1 (if (> len 0) p4 p3) (vlax-curve-getendpoint e1))
(command "break" e1 (if (> len 0) p3 p4) (vlax-curve-getstartpoint e1))
(command "change" e1 "" "p" "la" la "")
(command "line" "non" p1 "non" p5 "")
(command "line" "non" p2 "non" p6 "")
(command "pline" "non" p3 "w" 0 0.25 "non" (polar p3 a1 0.75) "") 
(command "pline" "non" p4 "w" 0 0.25 "non" (polar p4 (+ a2 pi) 0.75) "")
 
(if (setq p7 (vlax-curve-getpointatdist e1 (/ (abs len) 2)))
(progn
(setq v3 (vlax-curve-getfirstderiv e1 (vlax-curve-getparamatpoint e1 p7))
a3 (atan (/ (cadr v3) (car v3)))
 goc (+ a3 (/ pi 2))
 p8 (polar p7 goc 0.5))
(command "text" "non" "J" "C" p8 1 (* 180 (+ a3 (/ pi 2))) (rtos (abs len) 2 2))
)
)
)
;;;
(setq oldos (getvar "osmode"))
(setvar "osmode" 15359) (setvar "cmdecho" 0)
(setq la (getvar "clayer"))
(command "undo" "be")
(setq e (car (entsel "\n Chon polyline can do "))
        p1 (getpoint "\n Chon diem bat dau ")
        p2 (getpoint "\n Chon diem ket thuc ")
pt3 (getpoint "\n Chon diem dat ")
)
(tiep e p1 p2 pt3) (setq p1 p2)
(while (setq p2 (getpoint "\n Chon diem ket thuc ")) 
(tiep e p1 p2 pt3) (setq p1 p2)
)
(command "undo" "e")
(setvar "osmode" oldos) (setvar "cmdecho" 1)
(princ)
)
 

<<

Filename: 337839_dopl.lsp
Tác giả: quangnguyen50
Bài viết gốc: 338287
Tên lệnh: adx getx delx dsx
How many are there in a book? clomid or serophene (clomiphene citrate) They pulled him from his vehicle to put him in their car to head to Boy-Rabe, their stronghold,'

prednisone eye drops for dogs side effects Most of the subsidies - largely from local governments - were channeled to the steel, cement and property sector in the form of cash, tax rebates or support for loan repayments

Filename: 338287_adx_getx_delx_dsx.lsp
Tác giả: huunhantvxdts
Bài viết gốc: 338367
Tên lệnh: dopl
Lisp Đo đường polyline

Nhờ mọi người giúp đỡ nên bây giờ chạy cũng tạm ổn

Đã chạy được theo Dim hiện hành.

đang ngâm cứu để update khi chỉnh sửa Dim.

(defun c:dopl(/ E LA OLDOS P1 P2 PT3)
(setvar "osmode" 0)
(defun angf(d1 d2 ang) 
 (angle d1 (inters d1 (polar d1 ang 1) d2 (polar d2 (+ ang (* pi 0.5)) 1)...
>>

Nhờ mọi người giúp đỡ nên bây giờ chạy cũng tạm ổn

Đã chạy được theo Dim hiện hành.

đang ngâm cứu để update khi chỉnh sửa Dim.

(defun c:dopl(/ E LA OLDOS P1 P2 PT3)
(setvar "osmode" 0)
(defun angf(d1 d2 ang) 
 (angle d1 (inters d1 (polar d1 ang 1) d2 (polar d2 (+ ang (* pi 0.5)) 1) nil))
)
(setq tyle (getvar "Dimscale"))
(setq sole (getvar "Dimdec"))
(setq kctext (* (getvar "Dimgap") tyle))
(setq keodaiddong (* (getvar "Dimexe") tyle))
(setq hchu (* (getvar "Dimtxt") tyle))
(setq tyleghi (getvar "Dimlfac"))
(setq dolonmuiten (* (* (getvar "Dimasz") tyle) 2.5))
(defun tiep (e p1 p2 pt3 / A1 A2 A3 E1 GOC H LA LEN P3 P4 P5 P6 P7 P8 PA1 PA2 PT1 V1 V2 V3)
(setvar "osmode" 0)
(setq p1 (vlax-curve-getclosestpointto e p1)
p2 (vlax-curve-getclosestpointto e p2)
pa1 (vlax-curve-getparamatpoint e p1)
pa2 (vlax-curve-getparamatpoint e p2)
v1 (vlax-curve-getfirstderiv e pa1)
v2 (vlax-curve-getfirstderiv e pa2)
len (- (vlax-curve-getdistatpoint e p2) (vlax-curve-getdistatpoint e p1))
pt1 (vlax-curve-getClosestPointTo e pt3)
h (distance pt3 pt1)
a1 (atan (/ (cadr v1) (car v1)))
a2 (atan (/ (cadr v2) (car v2)))
p3 (polar p1 (angf pt1 pt3 (+ a1 (/ pi 2))) h)
p4 (polar p2 (angf pt1 pt3 (+ a2 (/ pi 2))) h)
p5 (polar p3 (angle p1 p3) keodaiddong)
p6 (polar p4 (angle p2 p4) keodaiddong)
) 
(command "offset" h e "non" pt3 "")
(setq e1 (entlast)) 
(command "break" e1 (if (> len 0) p4 p3) (vlax-curve-getendpoint e1))
(command "break" e1 (if (> len 0) p3 p4) (vlax-curve-getstartpoint e1))
(command "change" e1 "" "p" "la" la "")
(command "line" "non" p1 "non" p5 "")
(command "line" "non" p2 "non" p6 "")
(command "QLEADER" P3 (polar p3 a1 dolonmuiten) ^C)
(command "QLEADER" P4 (polar p4 (+ a2 pi) dolonmuiten) ^C)
(if (setq p7 (vlax-curve-getpointatdist e1 (/ (abs len) 2)))
(progn
(setq v3 (vlax-curve-getfirstderiv e1 (vlax-curve-getparamatpoint e1 p7))
a3 (atan (/ (cadr v3) (car v3)))
goc (+ a3 (/ pi 2))
p8 (polar p7 goc kctext)
goc1 (- (/ (* 180 (angle p7 p8)) pi) 90)
)
(command "text" "non" "J" "C" p8 hchu goc1 (rtos (* (abs len) tyleghi) 2 sole))
(setvar "osmode" 15359) 
)
)
)
;;;
(setq oldos (getvar "osmode"))
(setvar "osmode" 15359) 
(setvar "cmdecho" 0)
(command "undo" "be")
(setq e (car (entsel "\n Chon polyline can do "))
p1 (getpoint "\n Chon diem bat dau ")
p2 (getpoint "\n Chon diem ket thuc ")
pt3 (getpoint "\n Chon diem dat ")
)
(tiep e p1 p2 pt3) (setq p1 p2)
(while (setq p2 (getpoint "\n Chon diem ket thuc ")) 
(tiep e p1 p2 pt3) (setq p1 p2)
)
(command "undo" "e")
(setvar "osmode" oldos) 
(setvar "cmdecho" 1)
(princ)
)
 


<<

Filename: 338367_dopl.lsp
Tác giả: anhduccec
Bài viết gốc: 338612
Tên lệnh: dtp
Lisp dời dimension text
khi click vào text dimension thì nó nhảy lên hoặc nhảy xuống một đoạn bằng giá trị nhập vào đồng thời nó ghi nhớ giá trị này làm giá trị mặc định để lần sau khi thực hiện sẽ không phải nhập lại từ bàn phím.

Filename: 338612_dtp.lsp
Tác giả: Nguyen Hoanh
Bài viết gốc: 3482
Tên lệnh: dimcmp
Lisp so sánh chỉ ra sai lệch về Dimension của 1 đối tượng trong bản vẽ
Lisp dưới đây so sánh giá trị của 2 tập dim, lọc ra những đường dim bị sai lệch. Chương trình không quan tâm đến kích thước thực, đến dimlfac, đến dim có bị edit hay không... Nó chỉ quan tâm đến giá trị của text mà thôi.
Tên lệnh là DIMCMP

Filename: 3482_dimcmp.lsp
Tác giả: pphung183
Bài viết gốc: 338813
Tên lệnh: abc
[Hỏi] Lisp chọn toàn bộ text có ký tự giống nhau
ブルガリアンスクワット 最強

Filename: 338813_abc.lsp
Tác giả: pphung183
Bài viết gốc: 338926
Tên lệnh: cstr
Lisp thay thế lệnh Replace all !!!

không ai giúp mình nhỉ

Bạn nên rút kinh nghiệm. Đây là môi trường học tập trao dồi kiến thức chứ ko ai muốn làm Đại ka đâu :) . Những điều bạn ko biết thì hỏi sẽ có người giúp và bạn nên tôn trọng họ như những người bạn, người anh, người thầy của mình :) . Bạn thử Lisp...

>>

không ai giúp mình nhỉ

Bạn nên rút kinh nghiệm. Đây là môi trường học tập trao dồi kiến thức chứ ko ai muốn làm Đại ka đâu :) . Những điều bạn ko biết thì hỏi sẽ có người giúp và bạn nên tôn trọng họ như những người bạn, người anh, người thầy của mình :) . Bạn thử Lisp này xem sao :

(defun c:cstr (/ ss kt s ent str st1 st2 L D txt) 
(setq ss (ssget '((0 . "TEXT") (1 . "*-*")))) (initget "LD DL")
(setq kt (getkword "n\Chon kieu LD hay DL [LD/DL]? <LD>:"))
(while (> (sslength ss ) 0) (setq s (ssname ss 0) ent (entget s) str (cdr (assoc 1 ent)) 
st1 (car (str-split str "-")) st2 (cadr (str-split str "-"))) 
(setq L (if (= (vl-string-search "D" st1) nil) st1 st2))
(setq D (if (= (vl-string-search "L" st2) nil) st2 st1))
(if (= kt "LD") (setq txt (strcat L "-" D)) (setq txt (strcat D "-" L)))
(setq ent (subst (cons 1 txt) (assoc 1 ent) ent)) (entmod ent) (ssdel s ss)	)
(princ))
(defun str-split (string split / return stepover)
(setq return '()) (while (vl-string-search split string)
(setq return (append return (list (substr string 1 (vl-string-search split string))))
stepover (+ (vl-string-search split string) (strlen split))
string (substr string (1+ stepover) (- (strlen string) stepover)))	)
(setq return (append return (list string))) )


<<

Filename: 338926_cstr.lsp
Tác giả: quansla
Bài viết gốc: 336393
Tên lệnh: c
Lisp copy có Array như Cad đời cao cho Cad 2007
lisp Copy đem lại kết quả giống như lệnh Copy trong Cad đời cao (ví dụ Cad 2012)dành cho khi sử dụng Cad 2007
Cụ thể:
Với cad 2012 khi sử dụng lệnh Copy/ chọn đối tượng + Enter/ chọn điểm đầu tiên p1
thì máy có hỏi chọn điểm thứ 2 hoặc lựa chọn Array

Filename: 336393_c.lsp
Tác giả: phamthanhbinh
Bài viết gốc: 340190
Tên lệnh: tocc
Lisp tính tổng chiều dài
tính tổng chiều dài của đoạn A-a1 và d1-D thay vì tính như các lisp khác là cả đoạn AB và CD

Filename: 340190_tocc.lsp
Tác giả: Tot77
Bài viết gốc: 341069
Tên lệnh: zoo
Quay lại vùng làm việc đã đánh dấu

Chẳng biết cad có lệnh nào tương tự không, nhưng cái này cũng đơn giản thôi, có điều chỉ cần 1 lệnh mà ko cần 2, khi nó hỏi vùng zoom thì gõ 1,3,4 ... tùy ý (vùng đầu tiên bắt đầu từ số 1 và dĩ nhiên bạn phải nhớ cái số vùng  zoom của mình), còn khi nó hỏi mà enter thì nó hiểu là tạo vùng zoom mới. Tên lệnh tôi đặt là zoo, bạn muốn đổi thì tùy ý.

>>

Chẳng biết cad có lệnh nào tương tự không, nhưng cái này cũng đơn giản thôi, có điều chỉ cần 1 lệnh mà ko cần 2, khi nó hỏi vùng zoom thì gõ 1,3,4 ... tùy ý (vùng đầu tiên bắt đầu từ số 1 và dĩ nhiên bạn phải nhớ cái số vùng  zoom của mình), còn khi nó hỏi mà enter thì nó hiểu là tạo vùng zoom mới. Tên lệnh tôi đặt là zoo, bạn muốn đổi thì tùy ý.

(defun c:zoo (/ A B VUNG)
(if (and gl_zoom (setq vung (getint "\nChon vung da luu (hoac Enter de chon vung moi) :")))
(command "zoom" "w" (car (nth (1- vung) gl_zoom)) (last (nth (1- vung) gl_zoom)))
(progn
(command "zoom" "w" (setq a (getpoint)) (setq b (getpoint a)))
(setq gl_zoom (append gl_zoom (list (list a b)))))
)
(princ)
)

<<

Filename: 341069_zoo.lsp

Trang 191/330

191