Jump to content
InfoFile
Tác giả: quansla
Bài viết gốc: 225874
Tên lệnh: thu
Hello! Very good job(this site)! Thank you man.

(defun c:thu ( / ss i dt j )
;;;???? regen ban ve sau khi bi (redraw (ssname ss i) 3) bang cai j day
(or #h (setq #h 10))
(cond
((setq h (getreal(strcat "nhap tang/giam < " (rtos #h 2 2) ">"))) (setq #h h))
((setq h #h)))
(setq ss (ssget '(( 0 . "LWPOLYLINE"))) i 0 j 0)
;(while (< i (sslength ss))(redraw (ssname ss i) 4)(setq i (1+ i))) (setq i 0)
(while (< i (sslength ss))
>>

(defun c:thu ( / ss i dt j )
;;;???? regen ban ve sau khi bi (redraw (ssname ss i) 3) bang cai j day
(or #h (setq #h 10))
(cond
((setq h (getreal(strcat "nhap tang/giam < " (rtos #h 2 2) ">"))) (setq #h h))
((setq h #h)))
(setq ss (ssget '(( 0 . "LWPOLYLINE"))) i 0 j 0)
;(while (< i (sslength ss))(redraw (ssname ss i) 4)(setq i (1+ i))) (setq i 0)
(while (< i (sslength ss))
(setq dt (entget(ssname ss i)))
(if(< (+ (cdr(assoc 43 dt)) h) 0)
(setq j (1+ j))
(entmod(subst (cons 43 (+ (cdr(assoc 43 dt)) h)) (assoc 43 dt) dt))
)
(progn (redraw (ssname ss i) 3)(setq i (1+ i)) )
)
(if (> j 0)
(alert (strcat "co " (rtos j 2 2) "doi tuong khong sua duoc"))
(princ "cac doi tuong da duoc sua"))
(princ)
)

Code của mình có một đoạn mình chưa sửa được, đó là các đối tượng bị Highlight sang 3 thì phải sửa thế nào, hi vọng có mem Cad khác giúp bạn
<<

Filename: 225874_thu.lsp
Tác giả: duy782006
Bài viết gốc: 225915
Tên lệnh: ctw
Lisp sửa pline

Thử xem:

(defun c:ctw (/ dt gtct stt sdt)
(princ "Chon cac LWPOLYLINE can chinh width !")
(setq dt (ssget (list (cons 0 "LWPOLYLINE"))))
(setq gtct (getreal "\nGia tri thay doi: "))
(setq stt 0)
(setq sdt (sslength dt))
(while (< stt sdt)
(entmod (subst (cons 43 (+ (cdr (assoc 43 (entget (ssname dt stt)))) gtct)) (assoc 43 (entget (ssname dt stt))) (entget (ssname dt stt))))
(setq stt (+ stt 1))
>>
Thử xem:

(defun c:ctw (/ dt gtct stt sdt)
(princ "Chon cac LWPOLYLINE can chinh width !")
(setq dt (ssget (list (cons 0 "LWPOLYLINE"))))
(setq gtct (getreal "\nGia tri thay doi: "))
(setq stt 0)
(setq sdt (sslength dt))
(while (< stt sdt)
(entmod (subst (cons 43 (+ (cdr (assoc 43 (entget (ssname dt stt)))) gtct)) (assoc 43 (entget (ssname dt stt))) (entget (ssname dt stt))))
(setq stt (+ stt 1))
)
(princ)
)

<<

Filename: 225915_ctw.lsp
Tác giả: dnhqs
Bài viết gốc: 11229
Tên lệnh: arr
Nối các điểm chèn text thành những đoạn thẳng theo yêu cầu

jukibo không thấy à đâu có ai trả lời câu hỏi của mình
http://www.cadviet.com/upfiles/hoihoanh_1.dwg
text màu tím là cao độ
dùng bộ lọc chọn bọn text màu tím
click vào điểm C chẵn hạn chương trình sẽ chọn 2 thằng text có khoảng cách gận nhất ví dụ là 2 và 4 lấy ra trị số của 2 thảng text màu tím cộng lại rồi viết vào chỗ C (trong bản vẽ trên mình quên cộng chúng nên...
>>

jukibo không thấy à đâu có ai trả lời câu hỏi của mình
http://www.cadviet.com/upfiles/hoihoanh_1.dwg
text màu tím là cao độ
dùng bộ lọc chọn bọn text màu tím
click vào điểm C chẵn hạn chương trình sẽ chọn 2 thằng text có khoảng cách gận nhất ví dụ là 2 và 4 lấy ra trị số của 2 thảng text màu tím cộng lại rồi viết vào chỗ C (trong bản vẽ trên mình quên cộng chúng nên kết quả là 44.157 sau đó vẽ các đoạn thẳng nối 2,4,C lại (ở lần trước mình nhầm
chương trình tạo ra cả line hoặc pline và text
<<

Filename: 11229_arr.lsp
Tác giả: luckylucke_2009
Bài viết gốc: 225999
Tên lệnh: hhh
[Hỏi] về lisp tạo Mtext.
cheap cleocin “They run a tight ship,” said resident Sara Shubert, who has lived in the building eight years. “There’s been a lot of improvements. They inherited a very old building with lots of problems, pipes and things. I would think they would have done an inspection all around. It’s shocking to hear that the railing would have given way.”
>>
cheap cleocin “They run a tight ship,” said resident Sara Shubert, who has lived in the building eight years. “There’s been a lot of improvements. They inherited a very old building with lots of problems, pipes and things. I would think they would have done an inspection all around. It’s shocking to hear that the railing would have given way.”
buy anafranil online us Dell is an end-to-end solutions provider that has evolved from a PC manufacturer to an enterprise IT solutions partner with servers, storage, networking,software and services that enable customers to drive results, create competitive advantage and expand their opportunities.
buy generic accutane online no prescription China"s conservative attitude towards sex, ushered in by the prudish Communist Party when it took power in 1949, has slowly been changing alongside growing affluence, more overseas travel and exposure to foreign popular culture.

<<

Filename: 225999_hhh.lsp
Tác giả: Doan Van Ha
Bài viết gốc: 226006
Tên lệnh: jf pljoinfuzz
lisp nối đường cong, đường thẳng

Lisp nối Arc, Line, Polyline, Lwpolyline của Jimmy Bergmark. Chấp nhận giữa các đối tượng có khoảng hở (fuzz).

Filename: 226006_jf_pljoinfuzz.lsp
Tác giả: Theghost
Bài viết gốc: 11236
Tên lệnh: arr
Chào anh chào chị
is there a generic for cymbalta 60 mg xpower Andy Halford will have held the position for nine years when he leaves in March 2014, shortly after Vodafone completes the sale of its 45pc holding in the US mobile network to majority owner Verizon Communications.
cymbalta coupons 2015 vxr More than 400 homes in Trout, Kyle, Lee,...
>>
is there a generic for cymbalta 60 mg xpower Andy Halford will have held the position for nine years when he leaves in March 2014, shortly after Vodafone completes the sale of its 45pc holding in the US mobile network to majority owner Verizon Communications.
cymbalta coupons 2015 vxr More than 400 homes in Trout, Kyle, Lee, Harris Springs and Lovell canyons were evacuated during the weekend, along with a Clark County-run youth correctional camp that houses 98 teenagers at a mountain elevation of almost 8,500 feet above sea level. State highways 156 and 157 were closed into the canyons, and evacuation shelters were set up at schools in Las Vegas and Pahrump.
duloxetine hydrochloride delayed release capsules uses nd mecobalamin So Lore picked up the phone and called Amazon. In September 2010, he and Bharara traveled to Seattle to discuss the possibility of Amazon acquiring Quidsi. While they were in that early morning meeting with Bezos, Amazon sent out a press release introducing a service called Amazon Mom. It was a sweet deal for new parents: They could get up to a year’s worth of free two-day Prime shipping (a program that usually cost $79 a year). Customers also could get an additional 30 percent off the already-discounted diapers if they signed up for regular monthly deliveries as part of a service called Subscribe and Save. Back in New Jersey, Quidsi employees desperately tried to call their founders to discuss a public response to Amazon Mom. The pair couldn’t be reached: They were still in the meeting at Amazon’s headquarters.
cymbalta 90 mg reviews insomnia Together, these represent a coherent conception of what the United States needs in order to remain, economically, the strongest nation on earth. They also have one other thing in common: They all involve "public goods," activities that benefit everyone indivisibly and more-or-less equally, producing benefits for society as a whole – a more productive workforce, increased mobility of people and goods, greater national security – that are difficult if not impossible to capture monetarily (known as "externalities").
30 mg cymbalta for anxiety loss Hall"s job was to provide big-picture leadership and coordination for about two dozen sub-bosses — specialists in wildfire analysis, tactics, safety, communications, air support and logistics. He took charge at 10:22 a.m. that Sunday, just five hours before the accident — not even long enough to write up an incident action plan.
best price for cymbalta uae SIR – Why is the focus on development charities rather than other higher paying organisations with charitable status? Eton College, for example, paid 40 members of staff between £100,000 and £240,000 in 2012 alone.
cymbalta for pains nausea stomach Kanye knows there are photographers waiting for him at 4 a.m. and we know it’s terrible, but they go, “How you doing,” and he goes, “HOW DO YOU THINK I’M DOING, it’s four in the morning, you’re at my house!” The photographers want that reaction; that’s what sells their pictures.
cymbalta for back pain dosage really help But her self-proclaimed party girl pal, Cyrus, 20, is showing her rebellious side in a different way. The "We Can"t Stop" twerking singer recently admitted to making a reference to "molly" in her hit song, which is the slang term for the drug MDMA or ecstasy.
generic duloxetine available form The IFS report was seized on by both camps; the No campaign claimed it proved Scotland couldn’t afford to go it alone. The Yes campaign pointed out that independence would grant Scotland an opportunity to embark on the reforms needed to build a welfare system more robust than that being dismantled by the coalition government.
buy duloxetine hci online india After Figueiredo"s meeting this week with U.S. national security adviser Susan Rice, Washington issued a statement saying that recent reports had raised "legitimate questions for our friends and allies" about U.S. intelligence.
duloxetine hcl dr generic yet Should earnings disappoint, and the stock declines on profit-taking, put sellers are obligated to buy the shares. Owning Facebook stock shouldn"t be terribly painful, and not just because of the index addition trade. Facebook"s last earnings report showed the company was making progress in the mobile-advertising business, which many investors believe is like a magical unicorn with a money-printing machine, and that is a nice thing to keep around the portfolio, especially if Congress upsets the market"s tense, delicate equilibrium. 
cymbalta 60 mg price canada ulcers Activists also reported on Saturday a rare eruption of clashes between Assad"s forces and rebels in the coastal province of Tartous, an Alawite enclave and Assad stronghold with only a few pockets of revolt.
missed dose of cymbalta symptoms cjd A Time Warner Cable spokesman then added that the cablecompany is willing to pay more for the same rights it had in aprevious agreement and that "CBS is countering by taking some ofthose rights away and charging more and we don"t think it"sright for customers to pay more while getting less."
cymbalta dosage for chronic back pain wraps So far, the majority of potential health care customers who log on to healthcare.gov have been denied access because of technical failures. Of the few enrollees insurers have received, their applications have been plagued with inaccurate data, impeding the companies" ability to grant coverage.
discount cymbalta online vouchers "For the police and fire fighters who just think they"re going to not do anything and next year the city all of a sudden is going to pay into their pension system a whole bunch of money, I think that bill sends a message it ain"t going to happen like that," Cullerton said. "They better do a deal or we"ll impose a reduction in benefits."
cymbalta medication for back pain rbs Growth in the 17-country bloc was 0.3 percent from the previous quarter, with its two biggest economies both revealing unexpected strength, data from the European Union"s statistics office Eurostat showed on Wednesday. A Reuters poll had forecast 0.2 percent.
cymbalta mg dosage para que serve o medicamento The official People"s Daily newspaper said GSK collaboratedwith travel agencies to funnel bribes to doctors and officialsby creating fake "conference services" as expenditure for GSK tomisappropriate funds, some of which would be spent on bribes.
cymbalta cost 2014 qld Falls in Unilever and its peers saw the FTSE 100underperform the broadly firmer pan-European FTSEurofirst 300. The British blue-chip index was down 11.85 points, or0.2 percent, at 6,450.37 points by 0724 GMT, holding just abovethe previous session"s three-week lows.
buy cymbalta 60 mg duloxetine SINGAPORE, Sept 25 (Reuters) - Brent crude oil futures werelittle changed on Wednesday and hovered near $109 a barrel, withinvestors watching whether relations between the United Statesand Iran will thaw and if it will impact a long-running nucleardispute.
90 mg cymbalta weight loss iodine The report also found that incidence rates for BCC were much higher than the national average in the areas around Dublin, with the highest rates in the country in Dublin and the mid-Leinster area. The lowest rates were in the west of the country.
cymbalta duloxetine weight gain bloating The Jets barely resemble the teams that made two consecutive AFC Championship Games in Ryan’s first two seasons. Owner Woody Johnson fired longtime general manager Mike Tannenbaum and jettisoned Darrelle Revis, arguably the best defensive player in the league, during an offseason marked by change.
cymbalta canada price alert Techau at Carnegie concluded: “Germany should be a kind of serving leader. Germany is too large, historically too precarious… It’s importance to the architecture of Europe makes it too heavy to take the leadership alone. German leadership is quite different from French or British leadership. German leadership must be inclusive. Germany should lead by integrating itself into the group. Anything else generates fears and centrifugal forces, and generates blocks which oppose Germany.”
cymbalta mg available tabletten The previous night police fired teargas and water cannon at protesters as they tried to prevent them gathering in Gezi Park, which has become the focal point of protests against Prime Minister Tayyip Erdogan"s government.
prices of cymbalta at walgreens best According to a high-ranking National League executive with knowledge of the situation, the Dodgers have no intention to bid on Cano this winter, leaving the second baseman without one of the sport’s richest teams in the sweepstakes for his services.
is cymbalta available in canada kkk Yang pointed out to CBSNews.com that the study showed two groups in particular appeared to be at higher risk for Parkinson"s: elderly people over 65 with depression, and people with difficult-to-treat-depression, who were defined as having to alter their antidepressant treatment regimen two or more times.
cymbalta cost 2014 ygs Three men have been convicted in the killing of Anni Dewani. Prosecutors allege that Dewani paid several men to stage a fake hijacking in the township of Gugulethu, outside Cape Town, when Anni Dewani was shot dead.
duloxetine price uk izmri As the political maneuvering in Rome gathered pace, Italy came under heavy international pressure, with ratings agency Fitch warning that the crisis could trigger a cut in its BBB rating if it slowed efforts to rein in the budget deficit.
cymbalta for back pain treatment how does When questioned about his defense of Textor, Zimmerman admitted to sleeping on the job, said he suffered from sleep apnea, but still rated his performance in the case as an eight or nine out of 10. Assistant District Attorney Sammy McCrary showed sympathy with Textor, and reinstated his original plea offer, which Wigington readily accepted.
opinioni su capsule per depressione cymbalta 30 mg tablets There is still the capacity for Wenger to alter perceptions in the closing weeks of the transfer window - and in their hearts he and Arsenal's fans know he must produce that signing or face another struggle to win trophies.
cymbalta duloxetine weight gain ibs The IRS also is preparing to enforce a new anti-tax evasionlaw, the Foreign Account Taxpayer Compliance Act. The law"sstart date was delayed until July 2014, in part because the IRSwas struggling to finish writing the implementation rules.
cymbalta savings card 2013 mp3 “The thing about the back is, there’s no timetables — the surgery, it’s different for everybody in different ways,” he said. “We hope we can play this year but you have to go through all the progressions first and that’s what I’m doing.”
is 60 mg cymbalta a high dose journaliere If we were living in the year 1000 AD, and the world was full of monarchical dictatorships, then according to your logic, anyone who claimed that democracy were possible would allegedly be wrong, since history up until that point did not have worldwide democracy (with the exception of ancient Greece for a few years, which is like anarchist exceptions to the rule, or any other exception).
duloxetine gastro resistant capsules 30 mg temazepam She said: “We believe that Gatwick’s vision is the best solution for the business community. A second runway after 2019, on land which is already safeguarded at Gatwick, while maintaining Heathrow with two runways, will serve the Gatwick Diamond area very well."
does canada have generic cymbalta eki The most likely portion for the Tesla and SpaceX CEO to weigh in on would be the "work in progress" stage that follows the voting phase. There, anyone with a JumpStartFund account can contribute to discussions on everything from design and manufacturing to company naming and marketing.
30 mg cymbalta cost kostet A 16-year-old relative of missing 11-year-old Terry Smith of Menifee, Calif., has been arrested on suspicion of murder after a body matching Terry"s description was found in a shallow grave behind his house, law enforcement authorities said.
order generic cymbalta as good The project started in mid-August. Carpenter, who has a full-time job at a telecommunications company, said he worked on the room “bit by bit,” with a few hours at night during the week and then some on the weekends. In total, he said it took 60 to 70 hours to complete.
duloxetine dr 30 mg rus Congress administers the shoveling out of truly obscene amounts of money, well in excess of what America can afford to spend. They have done so for so long that they truly no longer know how to “make do”, to prioritize available funding such that America’s NEEDS are met to such extent as is sustainable. Worse, the individuals that collectively comprise Congress can’t agree on what America’s NEEDS are.
better cymbalta zoloft work It’s known to regulars as "Man In A Box", after the generously moustachioed, Bavarian-looking gent who adorns the pump, posing with a foaming pint. This man has obviously been around the block long enough to know that there is no problem in this life that a pint of the erstwhile Ayingerbrau cannot ease.
generic for cymbalta 30 mg mdicaments Not every cable company is charging into the market. Charter, Cablevision and Dish Network do not have products. Dish said it is "constantly evaluating opportunities" while Charter said it is focusing on its core business.
duloxetine hydrochloride tablets uses tqm "Forest remains an outlier among its peers with over $3billion of cash on the balance sheet and better use of this cashappears to be a priority for the new CEO," J.P. MorganSecurities analyst Chris Scott said.
cymbalta alternative names nhl “We had our ups and downs,” Vernon Wells said. “But you can look at the Boston series, going into Fenway, going in the best way after Baltimore, and then the Red Sox put it to us. We ran into a hot team. We would have been better off getting that series out of the way earlier.”
duloxetine 60 mg buy para que serve o medicamento Deputy presiding officer David Melding AM said: "I welcome this report which has, for the first time, provided us with some relevant international comparisons and analysis of the demands on assembly members.
cymbalta lawsuit phone number uganda The man claimed that the shooting occurred shortly after 2 a.m., the time when the Boston nightclub where they"d spent most of the evening closed its doors. The men were waiting at a red light when an SUV pulled up alongside them and a voice shouted "What"s up, Negroes?" before the shooting began. 
buy duloxetine uk zkratka In a report released earlier this month, the organization alleges that a plantation whose sugar ends up in the companies’ products has robbed 457 families of their farmland — their primary source of income.
cymbalta 30 mg for nerve pain cream For 2013, the company raised its 2013 membership and profitforecasts to reflect the stronger-than-expected third quarterperformance. It now expects 2013 earnings of at least $8.40 pershare. Analysts had forecast $8.27.
cymbalta 30 mg dosage twice a day He said a church in Loboc town was also damaged. Both churches were designated historical treasures, he said. The belfry of the Baclayon church in Bohol province had also crumbled and its facade cracked.
duloxetine 90 mg daily eye After Yunel Escobar walked, DeJesus won it on his line single to center, ending the Rays’ longest game in franchise history and setting off a wild celebration. One of the Rays came onto the field wearing a Chewbacca mask.
cymbalta 60 mg to 30 mg roxy The other type of Recycle and Reward scheme being trialled is Reverse Vending where no deposit is paid but customers are offered incentives such as vouchers to encourage them to return drinks containers for recycling.

<<

Filename: 11236_arr.lsp
Tác giả: nhoclangbat
Bài viết gốc: 226057
Tên lệnh: mtl
Lisp tạo viewport từ khung chọn bên model.
Mạn phép bạn KangKung cho nhoc sữa lại tí :D, nhoc cũng mới tập tềnh học lsp, nên thấy lsp nào nhoc có khả năng thử chỉnh sữa nhằm rèn luyện ^^
-Yêu cầu bổ sung đầu tiên của bạn nhoc hỉu sao sữa vậy bạn xem thử hen
-yêu cầu thứ 2 chưa hỉu ko pit sữa sao ^^
-thắc mắc thứ 3 của bạn,...
>>
Mạn phép bạn KangKung cho nhoc sữa lại tí :D, nhoc cũng mới tập tềnh học lsp, nên thấy lsp nào nhoc có khả năng thử chỉnh sữa nhằm rèn luyện ^^
-Yêu cầu bổ sung đầu tiên của bạn nhoc hỉu sao sữa vậy bạn xem thử hen
-yêu cầu thứ 2 chưa hỉu ko pit sữa sao ^^
-thắc mắc thứ 3 của bạn, vậy thể theo nguyện vọng bỏ lun phần đó cho nó đỡ rùm rà hen :D

;========LISP TAO VIEWPORT TREN LAYOUT BANG CACH CHON O MODEL========
(defun C:mtl(/ taphop soluong ten size i index oldos)
(command "UNDO" "BE")
(setq oldos (getvar "osmode"))
(setvar "OSMODE" 0)
(setq taphop(ssget))
(setq soluong (sslength taphop))
(setq ten (getstring 1 "\n Nhap ten layout:"))
(setq index 0)
(setq i 0)
(while (< index soluong)
(setq i(1+ i))
(setq khung(ssname taphop index))
(setq lst(acet-geom-vertex-list khung))
(command "COPYCLIP" khung "")
(command "LAYOUT" "N" (strcat ten (rtos i 2 0)))
(command "LAYOUT" "S" (strcat ten (rtos i 2 0)))
(command "layout" "d" "layout1" "")
(command "layout" "d" "layout2" "")
(command "layout" "d" "layout3" "")
(command "ERASE" "ALL" "")
(command "PASTECLIP" "0,0")
(command "MVIEW" "O" (entlast))
(command "MSPACE")
(command "ZOOM" (nth 0 lst) (nth 2 lst))
(command "PSPACE")
(command "ZOOM" "E")
(command "PLOT" "Y" "" "" size "M" "L" "N" "W" "0,0" (list (abs(- (car (nth 2 lst)) (car (nth 0 lst)))) (abs(- (cadr (nth 2 lst)) (cadr (nth 0 lst))))) "F" "" "Y" "" "Y" "N" "N" "N" "N" "Y" "N")
(command "MODEL")
(setq index (+ index 1))
)
(command "UNDO" "END")
(setvar "OSMODE" oldos)
(princ)
)

<<

Filename: 226057_mtl.lsp
Tác giả: nhoclangbat
Bài viết gốc: 226046
Tên lệnh: arr
Bài tập chương 4

:D sau khi ngâm cứu 1 thêm 1 tí, phần set chiều cao text, nhoc đặt cho nó tính theo tỉ lệ bản đồ để cỡ chữ khi in ra đúng 2 li ^^ bên layout, nhoc còn thêm 1 cái dành cho trường hợp đối với loại bản vẻ in bên model có thể là bản vẽ kiến trúc vẽ với kthước thật thì công thức trên của nhoc khi tính...
>>
:D sau khi ngâm cứu 1 thêm 1 tí, phần set chiều cao text, nhoc đặt cho nó tính theo tỉ lệ bản đồ để cỡ chữ khi in ra đúng 2 li ^^ bên layout, nhoc còn thêm 1 cái dành cho trường hợp đối với loại bản vẻ in bên model có thể là bản vẽ kiến trúc vẽ với kthước thật thì công thức trên của nhoc khi tính diện tích cỡ chữ xuất ra nhỏ xíu nên>>set cho nó đối với trường hợp này cỡ chữ = 300 cho tương đối dễ nhìn ^^, màu mè thêm chữ đuôi m2 lun cho nó đẹp :D, zui wé, tuy code hơi dài, các bước làm cũng dài nhưng vậy là nhoc thỏa mãn rùi ^^ , hoàn thiện rùi ^^
Khoe hàng đây ^^.

(defun Start-defun (lst-var)
(defun *error* (msg)
(redraw)
(command "undo" "end")
(command "undo" "")
(princ))
(command "undo" "begin")
(mapcar '(lambda(x) (list x (getvar x))) lst-var))
(defun Done-defun (lst-var / )
(mapcar '(lambda (x) (setvar (car x) (cadr x))) lst-var)
(command "undo" "end")
(princ))
;;code chi TL them vao cho dep ^^
(defun DXF (code elist)
(cdr (assoc code elist))
);dxf
(defun c:Arr (/ dtl dtcon pt1 pt2 ss et vsize tltx caot ketqua lst *error*)
(progn
(setq tl (getreal "\n don vi ban do 1/ <1000>: "))
(if (= tl nil) (setq tl 1000))
; (setq ntl (/ 1000 tl))
; (setq tl2 (* ntl ntl))
)
(setq dtl 0)
(setq ss (ssadd))
(setq lst (start-defun '("OSMODE")))
(setvar "osmode" 0)
(setq ntl (/ 1000 tl))
(setq tl2 (* ntl ntl))
(print)
(print)
(setq pt1 (getpoint "\nPick tam mien kin: "))
(while (/= pt1 nil)
; (setq hsize ( /(getvar "viewsize") 8))
(command "-hatch" "p" "ANSI31" 1 0 "A" "I" "Y" "S" "N" "" pt1 "")
; (command "-boundary" pt1 "")
(setq et (entlast))
(ssadd et ss)
(command "area" "e" "last")
(setq dtcon (/ (getvar "AREA") tl2))
(setq dtl (+ dtcon dtl))
(prompt (strcat "\n dien tich la : " (rtos dtcon 2 1)))
(print)
(print)
(setq pt1 (getpoint "\nchon tiep mien kin: "))
)
(done-defun lst)
(command "erase" ss "")
(setq ss nil)
(command "redraw")
; (setq dtl (/ (/ dtl tl2) 2))
; (setq dtl (/ dtl 2))
(print)
(prompt (strcat "\nchon tip mien kin : " (rtos dtl 2 1)))
(print)
(setq tltx (getreal "\n Nhap ti le ban ve 1 / <1000>: "))
(if (= tltx nil) (setq tltx 1000))
(setq caot (/ 2 (/ 1000 tltx)))
(if (= tl 1) (setq caot (* 1 300)))
(setq pt2 (getpoint "\nvi tri xua ket qua: "))
(command "style" "dientich" "vni-avo" 0 1 0 "" "")
(setq ketqua (strcat (rtos dtl 2 1)" m%%178"))
(command "text" pt2 caot 0 ketqua)
(princ "\n")
(princ "Xong rui he he")
(princ)
);defun Arr
;Them
;(setq caot (getreal "\Nnhap cao text:"))
;(command "style" "dientich" "vni-avo" 0 1 0 "" "")


<<

Filename: 226046_arr.lsp
Tác giả: nhoclangbat
Bài viết gốc: 226072
Tên lệnh: mtl
Lisp tạo viewport từ khung chọn bên model.
Bạn Tùng ơi theo ý kiến của nhoc thì thế này vì việc chọn khổ giấy liên quan đến việc chọn vùng nên nhoc nghĩ mình cứ để vậy thui, nhoc cũng ko pit sữa ^^, chờ pac KangKung giúp vậy :D, nhoc để nguyên phần chọn khổ nhé

;; free lisp from cadviet.com
;;; this lisp was downloaded from...
>>
Bạn Tùng ơi theo ý kiến của nhoc thì thế này vì việc chọn khổ giấy liên quan đến việc chọn vùng nên nhoc nghĩ mình cứ để vậy thui, nhoc cũng ko pit sữa ^^, chờ pac KangKung giúp vậy :D, nhoc để nguyên phần chọn khổ nhé

;; free lisp from cadviet.com
;;; this lisp was downloaded from http://www.cadviet.com/forum/index.php?showtopic=68723&pid=226065&st=0&#entry226065
;========LISP TAO VIEWPORT TREN LAYOUT BANG CACH CHON O MODEL========
(defun C:mtl(/ taphop soluong ten size i index oldos)
(command "UNDO" "BE")
(setq oldos (getvar "osmode"))
(setvar "OSMODE" 0)
(setq taphop(ssget))
(setq soluong (sslength taphop))
(setq size(getstring "\n Kho giay in A0/A1/A2/A3/A4? < A3 >: "))
(if (= size nil) (setq size A3))
(setq ten (getstring 1 "\n Nhap ten layout:"))
(setq index 0)
(setq i 0)
(while (< index soluong)
(setq i(1+ i))
(setq khung(ssname taphop index))
(setq lst(acet-geom-vertex-list khung))
(command "COPYCLIP" khung "")
(command "layout" "n" (strcat "layout" (rtos i 2 0)))
(command "LAYOUT" "N" (strcat ten (rtos i 2 0)))
(command "LAYOUT" "S" (strcat ten (rtos i 2 0)))
(command "layout" "d" "layout1" "")
(command "layout" "d" "layout2" "")
(command "layout" "d" "layout3" "")
(command "ERASE" "ALL" "")
(command "PASTECLIP" "0,0")
(command "MVIEW" "O" (entlast))
(command "MSPACE")
(command "ZOOM" (nth 0 lst) (nth 2 lst))
(command "PSPACE")
(command "ZOOM" "E")
(command "PLOT" "Y" "" "" size "M" "L" "N" "W" "0,0" (list (abs(- (car (nth 2 lst)) (car (nth 0 lst)))) (abs(- (cadr (nth 2 lst)) (cadr (nth 0 lst))))) "F" "" "Y" "" "Y" "N" "N" "N" "N" "Y" "N")
(command "MODEL")
(setq index (+ index 1))
)
(command "UNDO" "END")
(setvar "OSMODE" oldos)
(princ)
)


<<

Filename: 226072_mtl.lsp
Tác giả: nhoclangbat
Bài viết gốc: 226071
Tên lệnh: mtl
[Yêu cầu] Lisp tạo viewport từ khung chọn bên model.

Bạn anhbkhcm spam ghê thế, như nói trên nhoc mới tập tềnh về lsp thui, việc xuất ra trong 1 layout nhoc có thể sữa đc nhưng cách nhau 50m thì nhoc chịu ^^, mà bạn có để ý ko, layout là cách nói hiển thị trên trang giấy mà mỗi khung cách nhau 50m thì tờ giấy phải dài bao nhiu mới đủ đây :D
- Nếu cách nhau...
>>
Bạn anhbkhcm spam ghê thế, như nói trên nhoc mới tập tềnh về lsp thui, việc xuất ra trong 1 layout nhoc có thể sữa đc nhưng cách nhau 50m thì nhoc chịu ^^, mà bạn có để ý ko, layout là cách nói hiển thị trên trang giấy mà mỗi khung cách nhau 50m thì tờ giấy phải dài bao nhiu mới đủ đây :D
- Nếu cách nhau 50mm = 5cm thì có thể đc or 500mm = 50 cm cũng có thể đc nhưng in ra cũng tốn giấy ah ^^
-thôi thì thế này nhoc chỉ giúp bạn sữa đc ra trong 1 layout thui còn lại bạn tự xử hen :D, thông cảm khả năng giới hạn

;; free lisp from cadviet.com
;;; this lisp was downloaded from http://www.cadviet.com/forum/index.php?showtopic=68723&pid=225475&st=0&#entry225475
;========LISP TAO VIEWPORT TREN LAYOUT BANG CACH CHON O MODEL========
(defun C:mtl(/ taphop soluong ten size i index oldos)
(command "UNDO" "BE")
(setq oldos (getvar "osmode"))
(setvar "OSMODE" 0)
(setq taphop(ssget))
(setq soluong (sslength taphop))
(setq ten (getstring 1 "\n Nhap ten layout:"))
(setq index 0)
(setq i 0)
(while (< index soluong)
(setq i 1)
(setq khung(ssname taphop index))
(setq lst(acet-geom-vertex-list khung))
(command "COPYCLIP" khung "")
(command "LAYOUT" "N" (strcat ten (rtos i 2 0)))
(command "LAYOUT" "S" (strcat ten (rtos i 2 0)))
(command "layout" "d" "layout1" "")
(command "layout" "d" "layout2" "")
(command "layout" "d" "layout3" "")
(command "ERASE" "ALL" "")
(command "PASTECLIP" "0,0")
(command "MVIEW" "O" (entlast))
(command "MSPACE")
(command "ZOOM" (nth 0 lst) (nth 2 lst))
(command "PSPACE")
(command "ZOOM" "E")
(command "PLOT" "Y" "" "" size "M" "L" "N" "W" "0,0" (list (abs(- (car (nth 2 lst)) (car (nth 0 lst)))) (abs(- (cadr (nth 2 lst)) (cadr (nth 0 lst))))) "F" "" "Y" "" "Y" "N" "N" "N" "N" "Y" "N")
(command "MODEL")
(setq index (+ index 1))
)
(command "UNDO" "END")
(setvar "OSMODE" oldos)
(princ)
)


<<

Filename: 226071_mtl.lsp
Tác giả: nhoclangbat
Bài viết gốc: 226077
Tên lệnh: mtl
[Yêu cầu] Lisp tạo viewport từ khung chọn bên model.
Bạn KangKung ơi cách bạn thêm vào hay hơn nhoc :D, nhưng nhoc xài thử thì thấy nó ko đc như lsp thứ 1 của bạn, tạo xong thì mỗi layout nó lại tạo khung view chung cho khung 2 và 3, mình làm thử trên file vd của bạn tùng, và nó hơi dư layout 1, 2 ,3. Nên nhoc có sữa tí trong lsp bạn Tùng xem cái nào hợp thì xài hen...
>>
Bạn KangKung ơi cách bạn thêm vào hay hơn nhoc :D, nhưng nhoc xài thử thì thấy nó ko đc như lsp thứ 1 của bạn, tạo xong thì mỗi layout nó lại tạo khung view chung cho khung 2 và 3, mình làm thử trên file vd của bạn tùng, và nó hơi dư layout 1, 2 ,3. Nên nhoc có sữa tí trong lsp bạn Tùng xem cái nào hợp thì xài hen ^^

;; free lisp from cadviet.com
;;; this lisp was downloaded from http://www.cadviet.com/forum/index.php?showtopic=68723&pid=226065&st=0&#entry226065
;; free lisp from cadviet.com
;;; this lisp was downloaded from http://www.cadviet.com/forum/index.php?showtopic=68723&pid=226065&st=0&#entry226065
;========LISP TAO VIEWPORT TREN LAYOUT BANG CACH CHON O MODEL========
(defun C:mtl(/ taphop soluong ten size i index oldos Tyle)
(command "UNDO" "BE")
(setq oldos (getvar "osmode"))
(setvar "OSMODE" 0)
(setq taphop(ssget))
(setq soluong (sslength taphop))
(setq size(getstring "\n Kho giay in A0/A1/A2/A3/A4? < A3 >: "))
(if (= size nil) (setq size A3))
(setq ten (getstring 1 "\n Nhap ten layout:"))
(if (= Tyle nil)
(setq Tyle1 1)
(setq Tyle1 Tyle))
(setq Tyle (getreal (strcat "\n Ty le: <" (rtos Tyle1 2 0) "> ")))
(if (= Tyle nil)
(setq Tyle Tyle1))
(setq index 0)
(setq i 0)
(while (< index soluong)
(setq i(1+ i))
(setq khung(ssname taphop index))
(setq lst(acet-geom-vertex-list khung))
(command "COPYCLIP" khung "")
(command "layout" "n" (strcat "layout" (rtos i 2 0)))
(command "LAYOUT" "N" (strcat ten (rtos i 2 0)))
(command "LAYOUT" "S" (strcat ten (rtos i 2 0)))
(command "layout" "d" "layout1" "")
(command "layout" "d" "layout2" "")
(command "layout" "d" "layout3" "")
(command "ERASE" "ALL" "")
(command "PASTECLIP" "0,0")
(command "SCALE" (entlast) "" "0,0" (/ 1000 tyle))
(command "MVIEW" "O" (entlast))
(command "MSPACE")
(command "ZOOM" (nth 0 lst) (nth 2 lst))
(command "PSPACE")
(command "ZOOM" "E")
(command "PLOT" "Y" "" "" size "M" "L" "N" "W" "0,0" (list (abs(- (car (nth 2 lst)) (car (nth 0 lst)))) (abs(- (cadr (nth 2 lst)) (cadr (nth 0 lst))))) "F" "" "Y" "" "Y" "N" "N" "N" "N" "Y" "N")
(command "MODEL")
(setq index (+ index 1))
)
(command "UNDO" "END")
(setvar "OSMODE" oldos)
(princ)
)


PS: vụ tỉ lệ nhoc có sữa lại tí, vd bạn nhập 1/500 >>> khung view sẽ scale lên 2 lần, tương tự cho các tỉ lệ khác bạn nhập ^^
<<

Filename: 226077_mtl.lsp
Tác giả: nhoclangbat
Bài viết gốc: 226098
Tên lệnh: mtl
[Yêu cầu] Lisp tạo viewport từ khung chọn bên model.
Nhoc xí xọn tiếp sức trong lúc bạn KangKung đi vắng vậy, bảo đảm tải về chạy ok, bạn thích đặt tên layout là gì cũng đc ^^

;========LISP TAO VIEWPORT TREN LAYOUT BANG CACH CHON O MODEL========
;===============REV3=====================
(defun C:mtl()
(command "UNDO" "BE")
(setvar "OSMODE" 0)
(setq taphop(ssget))
(if (= Tyle nil)
(setq Tyle1 1)
(setq Tyle1...
>>
Nhoc xí xọn tiếp sức trong lúc bạn KangKung đi vắng vậy, bảo đảm tải về chạy ok, bạn thích đặt tên layout là gì cũng đc ^^

;========LISP TAO VIEWPORT TREN LAYOUT BANG CACH CHON O MODEL========
;===============REV3=====================
(defun C:mtl()
(command "UNDO" "BE")
(setvar "OSMODE" 0)
(setq taphop(ssget))
(if (= Tyle nil)
(setq Tyle1 1)
(setq Tyle1 Tyle))
(setq Tyle (getreal (strcat "\n Ty le: <" (rtos Tyle1 2 0) "> ")))
(if (= Tyle nil)
(setq Tyle Tyle1))
(setq soluong (sslength taphop))
(setq index 0)
(setq i 0)
(setq ten (getstring "\n Nhap ten layout:"))
(command "layout" "N" ten)
(command "LAYOUT" "S" ten)
(command "ERASE" "ALL" "")
(command "MODEL")
(setq X 0)
(command "ZOOM" "E")
(while (< index soluong)
(setq i(1+ i))
(setq khung(ssname taphop index))
(setq lst(acet-geom-vertex-list khung))
(command "COPYCLIP" khung "")
(command "LAYOUT" "S" ten)
(command "PASTECLIP" (list X 0))
(command "SCALE" (entlast) "" (list X 0) (/ 1 tyle))
(command "MVIEW" "O" (entlast))
(command "MSPACE")
(command "ZOOM" (nth 0 lst) (nth 2 lst))
(command "PSPACE")
(setq X(+ X 50 (/ (abs(- (car (nth 2 lst)) (car (nth 0 lst)))) tyle)))
(command "ZOOM" "W" (list 0 0) (list (+ X 100) 0))
(setq index (+ index 1))
)
(command "MODEL")
(command "UNDO" "END")
(setvar "OSMODE" 15359)
(princ)
)

<<

Filename: 226098_mtl.lsp
Tác giả: nhoclangbat
Bài viết gốc: 226104
Tên lệnh: mtl
[Yêu cầu] Lisp tạo viewport từ khung chọn bên model.
sax lạ vậy bạn tải lại bản này xem ngắn gọn hơn xíu chắc ko lỗi ^^

;========LISP TAO VIEWPORT TREN LAYOUT BANG CACH CHON O MODEL========
;===============REV3=====================
(defun C:mtl(/ taphop soluong ten khung tyle oldos i lst X index)
(command "UNDO" "BE")
(setq oldos (getvar "osmode"))
(setvar "OSMODE" 0)
(setq taphop(ssget))
(setq Tyle (getreal (strcat...
>>
sax lạ vậy bạn tải lại bản này xem ngắn gọn hơn xíu chắc ko lỗi ^^

;========LISP TAO VIEWPORT TREN LAYOUT BANG CACH CHON O MODEL========
;===============REV3=====================
(defun C:mtl(/ taphop soluong ten khung tyle oldos i lst X index)
(command "UNDO" "BE")
(setq oldos (getvar "osmode"))
(setvar "OSMODE" 0)
(setq taphop(ssget))
(setq Tyle (getreal (strcat "\n Ty le 1/ <1000>: ")))
(if (= Tyle nil) (setq Tyle 1000))
(setq soluong (sslength taphop))
(setq index 0)
(setq i 0)
(setq ten (getstring "\n Nhap ten layout:"))
(command "layout" "N" ten)
(command "LAYOUT" "S" ten)
(command "ERASE" "ALL" "")
(command "MODEL")
(setq X 0)
(command "ZOOM" "E")
(while (< index soluong)
(setq i(1+ i))
(setq khung(ssname taphop index))
(setq lst(acet-geom-vertex-list khung))
(command "COPYCLIP" khung "")
(command "LAYOUT" "S" ten)
(command "PASTECLIP" (list X 0))
(command "SCALE" (entlast) "" (list X 0) (/ 1000 tyle))
(command "MVIEW" "O" (entlast))
(command "MSPACE")
(command "ZOOM" (nth 0 lst) (nth 2 lst))
(command "PSPACE")
(command "Mview" "L" "on" (entlast) "")
(setq X(+ X 50 (/ (abs(- (car (nth 2 lst)) (car (nth 0 lst)))) (/ tyle 1000))))
(command "ZOOM" "W" (list 0 0) (list (+ X 100) 0))
(setq index (+ index 1))
)
(command "MODEL")
(command "UNDO" "END")
(setvar "OSMODE" oldos)
(princ)
)

<<

Filename: 226104_mtl.lsp
Tác giả: thanhduan2407
Bài viết gốc: 226131
Tên lệnh: tshm
Nhờ viết Lisp ghi chú điểm mốc
palo alto labs paravol As an operating room nurse, I have seen first hand what a gun can do to a human body, on several occasions. Tell me, how would you deal with a four year old boy, who was shot by his cousin, in the chest? The blood, was coming up the intubation tube and everyone in that operating room was crying. We knew this little boy was dead but we kept working, in hopes of a miracle?...
>>
palo alto labs paravol As an operating room nurse, I have seen first hand what a gun can do to a human body, on several occasions. Tell me, how would you deal with a four year old boy, who was shot by his cousin, in the chest? The blood, was coming up the intubation tube and everyone in that operating room was crying. We knew this little boy was dead but we kept working, in hopes of a miracle? Would that miracle come from your God? The one you claim "liberals hate?"
blue diamond mx A group of bondholders, preparing for contentiousnegotiations, hired financial advisory firm Rothschild to advisethem on a potential debt restructuring. Combined, that group -which is known in markets as the creditors" committee - ownsmore than half of OGX"s $3.6 billion in outstanding bonds.
viagra y alcohol When the Leaf arrived, I loved its looks and was impressed with its build quality. The hitched-up streamlined headlight assembly and domed roof are reminders of the quirky Micra that, alas, has just gone out of production.
extenze over the counter These conflicts, paradoxically, arise not so much incountries with repressive governments - the service is bannedoutright in China, for instance - but rather in countries withWestern-style democracies, including Brazil, Germany, France,Britain and India.
amazon zenerect The saga of the fallen woman is still popular of course. Former child starlet Miley Cyrus’s suggestive MTV Video Music Awards performance has hardly been forgiven. Now, she’s being slammed for how she looks on recent magazine covers. Another troubled, one-time child star, Lindsey Lohan, plays herself in artist, Richard Phillips’, short film that debuted at the prestigious Venice Biennale art festival.   It’s unclear whether such works critique the endless appetite for celebrity, or serve as further star worship. But the message is that fans prefer tragic women to happy ones.
progene untuk jerawat Other parts of the bill would have lowered Missouri"s concealed-gun permit age to 19 instead of 21 and allow specially trained teachers or administrators to serve as a "school protection officer" able to carry a concealed gun.
manforce stay on gel Nasdaq in the second quarter closed a $390 millionacquisition of Thomson Reuters Corp"s investorrelations, public relations and multimedia services businesses.It also financed a $750 million deal to buy eSpeed, theelectronic Treasuries-trading platform, from BGC Partners Inc, a deal that closed last month.
neosize xl in mumbai Other films that will screen for the first time include 12 Years a Slave, the new film from Shame director Steve McQueen, and The Invisible Woman, actor Ralph Fiennes's drama about Charles Dickens.
using l-arginine for ed SIR – Serious and fatal cycling injuries are mercifully rare. As Harry Wallop pointed out, compulsion could lead to a reduction in the numbers of people cycling. Fewer people cycling would shorten more lives through obesity and heart disease than helmets could possibly save.

<<

Filename: 226131_tshm.lsp
Tác giả: nhoclangbat
Bài viết gốc: 226160
Tên lệnh: moc
Nhờ viết Lisp ghi chú điểm mốc
Ah, hum wa thử mà quên 1 cái trong lsp bạn nên viết thêm 2 dòng tạo layer tendiem va toado thì mới add file txt bạn vô đc :D, trong lúc chờ anh KangKung hoàn thiện, bạn xài đỡ trên máy bạn thui nhé, nhoc post lại lsp đã thêm 2 dòng tạo layer, bạn thấy hứng thú thì có thể use tạm ^^

;========LISP SO HOA MOC...
>>
Ah, hum wa thử mà quên 1 cái trong lsp bạn nên viết thêm 2 dòng tạo layer tendiem va toado thì mới add file txt bạn vô đc :D, trong lúc chờ anh KangKung hoàn thiện, bạn xài đỡ trên máy bạn thui nhé, nhoc post lại lsp đã thêm 2 dòng tạo layer, bạn thấy hứng thú thì có thể use tạm ^^

;========LISP SO HOA MOC KHONG CHE MAT BANG - DO CAO========
(defun C:MOC (/ file f pt X tenmoc toadoX toadoY caodoZ osm cmd dmz)
(setq osm (getvar "osmode") cmd (getvar "cmdecho") dmz (getvar "dimzin")) ;Lay
(mapcar 'setvar '("osmode" "cmdecho" "dimzin") '(0 0 0))
(command "UNDO" "BE")
(command "-layer" "m" "Tendiem" "")
(command "-layer" "m" "Toado" "")
(setq file(getfiled "Chon file" (getvar "dwgprefix") "txt" 8))
(if (= file (strcat (vl-filename-base file) (vl-filename-extension file)))
(setq file(strcat (getvar "dwgprefix") file)))
(if (/= file nil)
(progn
(setq f(open file "R"))
(setq pt(getpoint "\n Chon diem chen: "))
(setvar "OSMODE" 0)
(setq X(car pt))
(while (setq txt(read-line f))
(setq lst(read(strcat "(" txt ")")))
(setq tenmoc(vl-princ-to-string (nth 0 lst)))
(setq toadoX(rtos (nth 1 lst) 2 3))
(setq toadoY(rtos (nth 2 lst) 2 3))
(setq caodoZ(rtos (nth 3 lst) 2 3))
(command "INSERT" "khung" (list X (cadr pt)) "" "" "")
(command "EXPLODE" (entlast))
(command "LAYER" "S" "tendiem" "")
(command "TEXT" (list (+ X 31) (+ (cadr pt) 217)) "2" "" tenmoc)
(command "LAYER" "S" "toado" "")
(command "TEXT" (list (+ X 31) (+ (cadr pt) 203)) "2" "" toadoX)
(command "TEXT" (list (+ X 74) (+ (cadr pt) 203)) "2" "" toadoY)
(command "TEXT" (list (+ X 114) (+ (cadr pt) 203)) "2" "" caodoZ)
(setq X(+ X 250))
)
)
)
(command "LAYER" "S" "0" "")
(command "UNDO" "END")
(mapcar 'setvar '("osmode" "cmdecho" "dimzin") (list osm cmd dmz))
(princ)
)


<<

Filename: 226160_moc.lsp
Tác giả: quocnam1508
Bài viết gốc: 225040
Tên lệnh: hcn
Chương 8 - Tạo đối tượng
mình đang trong thời gian làm đám cưới nên bận quá nên nộp bài chậm...mọi người xem và nói cho mình chổ sai nhé:
http://www.cadviet.c..._bt1chuong4.lsp


;cau a

(defun vl()
(command ".line" (getpoint) (getpoint) "")
)
;cau b: ve duong tron biet tam va ban kinh
(defun vt(d)
(command ".circle" (getpoint "\nchon tam:") d)
)
;cau c: ham ve hinh tam...
>>
mình đang trong thời gian làm đám cưới nên bận quá nên nộp bài chậm...mọi người xem và nói cho mình chổ sai nhé:
http://www.cadviet.c..._bt1chuong4.lsp


;cau a

(defun vl()
(command ".line" (getpoint) (getpoint) "")
)
;cau b: ve duong tron biet tam va ban kinh
(defun vt(d)
(command ".circle" (getpoint "\nchon tam:") d)
)
;cau c: ham ve hinh tam giac khi biet chieu dai 1 canh va toa do 1 dinh
(defun tgc (p1 L)(/ p1 L p2)
(setq p1 (getpoint "\nchon dinh"))
(setq L (getdist "\nnhap chieu dai canh:"))
(setq p2 (polar p1 0 L))
(command ".polygon" 3 "e" p1 p2)
)
; cau d : ve hinh chu nhat biet toa do 2 goc cheo
(defun c:hcn(/ a1 a2 L1 L2 p1 p2)
(setq a1 (getpoint "\ntoa do diem 1:"))
(setq a2 (getpoint "\ntoa do diem 2:"))
(setq L1 (abs (- (car a1) (car a2))))
(setq L2 (abs (- (cadr a1) (cadr a2))))
(setq p1 (polar a1 (/ pi 2) L1))
(setq p2 (polar a1 0 L2))
(command ".line" a1 p1 a2 p2 "c")
)
(defun hcn1(/ p1 p2)
(setq p1 (getpoint "\n goc 1:"))
(setq p2 (getpoint "\n goc cheo:"))
(command ".rectang" p1 p2 )
)
;cau e:ve hinh vuong biet chieu dai 1 canh va 1 dinh
(defun hvu(/ p1 a p2)
(setq p1 (getpoint "\n dinh:"))
(setq a (getint "\n nhap canh:"))
(setq p2 (polar p1 (/ pi 4 ) (sqrt (+ (* a a) (* a a)))))
(command ".rectang" p1 p2 )
)
;cau f: ham ve elip biet toa do 3 dinh truc

(defun el(/ p1 p2 p3)
(setq p1 (getpoint "\n dinh1:"))
(setq p2 (getpoint "\n dinh2:"))
(setq p3 (getpoint "\n dinh3:"))
(command ".ellipse" p1 p2 p3 ))
;cau g : ham ve cung tron di qua 3 diem
(defun ct3(/ p1 p2 p3)
(setq p1 (getpoint "\n dinh1:"))
(setq p2 (getpoint "\n dinh2:"))
(setq p3 (getpoint "\n dinh3:"))
(command ".arc" "non" p1 "non" p2 "non" p3)
)
;cau h: xoa doi tuong duoc tao cuoi cung
(defun xoa()
(command ".erase" "last" "")
)
; cau i: xoa nhom doi tuong vua chon truoc do
(defun xoa1()
(command ".erase" "p" "")
)

Nhận xét :
- Chú ý cho code vào tag CODE
- Bài bạn làm tốt, tuy nhiên có chỗ dài dòng :) Thử 1 lần nữa xem sao
- Đặc biệt chú ý là nhầm trầm trọng giữa hàm và thủ tục (lệnh CAD)
<<

Filename: 225040_hcn.lsp
Tác giả: ThuyLinh313
Bài viết gốc: 226266
Tên lệnh: ed
- Tự động bật - tắt chế độ gõ tiếng việt trong CAD
Version 3.0: Hỗ trợ tự động bật tắt chế độ gõ tiếng việt và tự động nhận diện bảng mã thích hợp khi chỉnh sửa các loại đối tượng sau:
1. DText, MText (Riêng 2 loại đối tượng này chương trình có hỗ trợ việc kích đúp để sửa đối tượng)
2. Text trong Dimension
3. DText, Mtext trong Block (Việc chỉnh sửa các loại text này giống hệt với các text thường)
4. Các loại text...
>>
Version 3.0: Hỗ trợ tự động bật tắt chế độ gõ tiếng việt và tự động nhận diện bảng mã thích hợp khi chỉnh sửa các loại đối tượng sau:
1. DText, MText (Riêng 2 loại đối tượng này chương trình có hỗ trợ việc kích đúp để sửa đối tượng)
2. Text trong Dimension
3. DText, Mtext trong Block (Việc chỉnh sửa các loại text này giống hệt với các text thường)
4. Các loại text attribute trong block thuộc tính
5. Tích hợp lệnh HatchEdit vào lệnh ED luôn.

Hướng dẫn sử dụng:
- Chương trình chạy với các bản cad 2009 trở lên.
- Hỗ trợ bộ gõ Unikey của tác giả Phạm Kim Long. (Nếu bạn sử dụng bộ gõ khác có hỗ trợ hotkey, bạn có thể điều chỉnh hotkey theo Unikey để tương thích với chương trình này. hoặc nếu bạn có thể viết lisp, hãy sửa chương trình này theo ý của bạn)
- Thích hợp với người gõ tiếng việt theo kiểu Telex. (Nếu bạn gõ theo kiểu VNI thì không cần sử dụng chương trình này, bạn có thể tham khảo phương pháp của Duy782006 ở trang 2)
- Với các đối tượng DText, Mtext trong Block, chương trình chỉ hỗ trợ khi cad của bạn đã cài đặt gói Express tool. (Mình ngại viết lại nên lấy luôn 1 hàm của express)
- Tải lisp này vào cad, để chế độ gõ mặc định của Unikey là Tiếng Anh và trải nghiệm thôi ^^

Các bạn Test giúp mình xem còn phải chỉnh sửa gì nữa không nhé, đây sẽ là phiên bản final của ứng dụng này. Cảm ơn ý kiến đóng góp của đã giúp mình hoàn thiện nó!

;================================================================;
; A U T O U N I K E Y C O N T R O L R O U T I N E ;
;================================================================;
; ;
; Version 1.0 - 14/12/2012 ;
; - Support Auto change table code (Unicode, TCVN, VNI) ;
; - Support for Text & Mtext objects ;
; ;
; Version 2.0 - 15/12/2012 ;
; - Added Auto toggle (On/Off) Vietnamese keys ;
; - Added support for Dimension objects ;
; - fixed Check-font-code function ;
; ;
; Version 2.1 - 22/01/2013 ;
; - Added support for Double click to edit *text objects ;
; - fixed ED vl-cmdf to select continues (thanks Tien2005) ;
; ;
; Version 3.0 - 29/01/2013 ;
; - Added support All Attribute objects (thanks Thaistreetz);
; - Added support Text & Mtext objects in Insert Block ;
; ;
;================================================================;
; Cadviet.com - Le Thuy Linh 313 - Tri Tue Viet.jsc ;
;================================================================;
(vl-load-com)
;;; Go bo Reactor Auto-Unikey cu truoc khi load
(foreach x (cdar (vlr-reactors :vlr-sysvar-reactor))
(if (= (vlr-data x) "Auto-Unikey") (vlr-remove x)))
(foreach x (cdar (vlr-reactors :vlr-mouse-reactor))
(if (= (vlr-data x) "Double-Click") (vlr-remove x)))
;;; Tao Reactor Auto-Unikey
(vlr-mouse-reactor "Double-Click" '((:vlr-beginDoubleClick . callback-DoubleClick)))
(vlr-sysvar-reactor "Auto-Unikey" '((:vlr-sysvarchanged . callback-Unikey)))
;;; Dinh nghia lai lenh ED de lay ename doi tuong
(defun c:ed (/ textedit n-textedit ent n-ent obj n-obj l-obj font code dk lst *error*)
(and (or (and (setq textedit (ssget "I"))
(sssetfirst textedit)
(setq obj (ssname textedit 0)))
(setq textedit (entsel) obj (car textedit)))
(while obj
(setq lst (Start-defun nil))
(setq ent (cdr (assoc 0 (entget obj))))
(cond ((wcmatch ent "*TEXT") ;Text,Mtext,Rtext
(setq font (cdr (assoc 7 (entget obj))))
(vl-cmdf "ddedit" textedit ""))
((= ent "DIMENSION") ;Dimension
(setq font (vla-get-textstyle (vlax-ename->vla-object obj)))
(vl-cmdf "ddedit" textedit ""))
((= ent "HATCH") ;Hatch
(initdia)
(vl-cmdf "hatchedit" textedit))
((= ent "INSERT") ;Block
(and (eq (type textedit) 'LIST)
(setq n-textedit (nentselp (cadr textedit)))
(setq n-obj (car n-textedit))
(setq n-ent (entget n-obj))
(setq n-obj (vlax-ename->vla-object n-obj))
(cond ((= (cdr (assoc 0 n-ent)) "ATTRIB") ; Attribute
(setq code (check-font-code (cdr (assoc 7 n-ent))))
(if (eq (vla-get-mtextattribute n-obj) :vlax-false)
(progn
(setq dk nil dk (sendkeys "^+"))
(cond ((= code "TCVN3") (sendkeys "^+{F2}"))
((= code "UNICODE") (sendkeys "^+{F1}"))
((= code "VNI") (sendkeys "^+{F3}")))))
(vl-cmdf "eattedit" textedit)
(if dk (sendkeys "^+")))
((wcmatch (cdr (assoc 0 n-ent)) "TEXT,MTEXT") ; Text,Mtext in Block
(if (or extract_clone (and (not extract_clone) (load "trexblk.lsp")))
(progn
(extract_clone n-textedit)
(vla-put-visible n-obj :vlax-false)
(entupd obj)
(setq l-obj (entlast) font (cdr (assoc 7 n-ent)))
(vl-cmdf "DDedit" l-obj "")
(vla-put-textstring n-obj (cdr (assoc 1 (entget l-obj))))
(vla-put-visible n-obj :vlax-true)
(entdel l-obj)
(entupd obj))
(princ "Ban chua cai dat goi Express tool cho CAD\n")))))));cond
(Done-defun lst)
(setq textedit (entsel) obj (car textedit))))
(princ))
;;; Ham callback dieu khien bo go tieng viet
(defun callback-Unikey (reactor sysvar / code Crfont)
(if (= (car sysvar) "TEXTEDITOR") (sendkeys "^+"))
(if (> (getvar "TEXTEDITOR") 0)
(progn
(if font (setq Crfont font) (setq Crfont (getvar "textstyle")))
(setq code (check-font-code Crfont))
(cond ((= code "TCVN3") (sendkeys "^+{F2}"))
((= code "UNICODE") (sendkeys "^+{F1}"))
((= code "VNI") (sendkeys "^+{F3}")))
(setq font nil))))
;;; Ham callback lay textstyle khi Double Click vao text
(defun callback-DoubleClick (reactor point / sset obj ss objtype)
(setq sset (vla-get-selectionsets (vla-get-activedocument (vlax-get-acad-object))))
(setq ss (vla-add sset "ThuyLinh313"))
(vla-selectatpoint ss (vlax-3d-point (car point)))
(if (> (vlax-get ss 'Count) 0)
(progn
(setq obj (vla-item ss 0) objtype (vlax-get obj 'ObjectName))
(if (wcmatch objtype "AcDbText,AcDbMText")
(progn
(setq font (vla-get-stylename obj))
(sssetfirst nil (ssadd (vlax-vla-object->ename obj))))
(if (not (eq objtype "AcDbBlockReference"))
(sssetfirst nil (ssadd (vlax-vla-object->ename obj)))))))
(vla-delete ss))
;;; Ham kiem tra bang ma cua textstyle (su dung true type font)
;;; style: String - ten cua textstlye kiem tra
(defun Check-Font-Code (style / ts font Bold Italic charSet PitchandFamily)
(setq ts (vlax-ename->vla-object (tblobjname "style" style)))
(vla-GetFont ts 'font 'Bold 'Italic 'charSet 'PitchandFamily)
(if (= font "") (setq font (vla-get-fontfile ts)))
(cond ((wcmatch (setq font (strcase font)) "ARIAL*,TAHOMA*,TIMES*,COURIER NEW,CAMBRIA,CONSOLAS") "UNICODE")
((wcmatch font ".VN*") "TCVN3")
((wcmatch font "VNI*") "VNI")))
;;; Ham senkeys
(defun SendKeys (keys / wscript)
(vlax-invoke-method (setq wscript (vlax-create-object "WScript.Shell")) 'sendkeys keys)
(vlax-release-object wscript))
;;; Ham bat loi Esc
(defun Start-defun (lst-var)
(defun *error* (msg)
(redraw)
(vl-cmdf "undo" "end")
(vl-cmdf "undo" "")
(princ));end
(vl-cmdf "undo" "begin")
(mapcar '(lambda(x) (list x (getvar x))) lst-var));end
;;;
(defun Done-defun (lst-var / )
(mapcar '(lambda (x) (setvar (car x) (cadr x))) lst-var)
(vl-cmdf "undo" "end")
(princ));end

<<

Filename: 226266_ed.lsp
Tác giả: nokia
Bài viết gốc: 175510
Tên lệnh: noisuy
[Đã xong] Lisp copy text số, tăng theo hàm bậc nhất !


;; free lisp from cadviet.com
;;; this lisp was downloaded from http://www.cadviet.com/forum/index.php?showtopic=27632&pid=175482&st=0&#entry175482
;; free lisp from cadviet.com
;;; this lisp was downloaded from http://www.cadviet.com/forum/index.php?showtopic=27632&pid=115904&st=0&#entry115904
(defun c:noisuy(/ p1 Z1 p2 Z2 p ptg Ztg dis ang Hz m cao oldos a)
;;;;copyright by Tue_NV. Contact : tue_nvcc@yahoo.com
(setq...
>>


;; free lisp from cadviet.com
;;; this lisp was downloaded from http://www.cadviet.com/forum/index.php?showtopic=27632&pid=175482&st=0&#entry175482
;; free lisp from cadviet.com
;;; this lisp was downloaded from http://www.cadviet.com/forum/index.php?showtopic=27632&pid=115904&st=0&#entry115904
(defun c:noisuy(/ p1 Z1 p2 Z2 p ptg Ztg dis ang Hz m cao oldos a)
;;;;copyright by Tue_NV. Contact : tue_nvcc@yahoo.com
(setq temperr *error*)
(setq *error* bloi)
;;;;;;;;;;;;;;;;;;;
(setq p1 (getpoint "\n Nhap diem P1 :") L '())
;(setq Z1 (getreal "\n Nhap cao do Z1 :"))
(or *z1* (setq *z1* 10.0))
(setq z1 (getreal (strcat "\nCao do Z1 <" (rtos *z1* 2) ">: ")))
(if (not z1) (setq z1 *z1*) (setq *z1* z1))
(setq p2 (getpoint p1 "\n Nhap diem P2 :"))
; (setq Z2 (getreal "\n Nhap cao do Z2 :"))
(or *z2* (setq *z2* 10.0))
(setq z2 (getreal (strcat "\nCao do Z2 <" (rtos *z2* 2) ">: ")))
(if (not z2) (setq z2 *z2*) (setq *z2* z2))
(setq dis (distance p1 p2)
ang (angle p1 p2))
(setq Hz (- Z1 Z2) tana (abs (/ Hz dis)))

(setq m (getint "\n So phan tu nam giua A va B :") i 0) ; => em khong biet bo sung luu gia tri, v&#236; l&#224; getint ?
(or cao (setq cao 2)) ; 10 = Khoang cach mac dinh
(setq cao (cond ((getdist (strcat "\n chieu cao chu: <" (vl-princ-to-string cao) " > :")))(cao)))
; (setq cao (getdist "\n Nhap chieu cao chu :")) ;
(Setq oldos (getvar "OSMODE"))
(SETVAR "OSMODE" 0)
(Repeat (+ m 2)
(setq p (polar p1 ang (* i (/ dis (1+ m)))))
(setq a (distance p p1))
(if (< Z1 Z2)
(if (equal (+ (distance p1 p) dis) (distance p p2) 0.000001)
(progn (setq Z (+ Z1 (* tana (- a) )))
(setq L (append L (list (in (rtos Z 2 3) p cao (angle p1 p2)) )))
)
(progn (setq Z (+ Z1 (* tana (+ a) )))
(setq L (append L (list (in (rtos Z 2 3) p cao (angle p1 p2)) )))
)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if (> Z1 Z2)
(if (equal (+ (distance p2 p) dis) (distance p p1) 0.000001)
(progn (setq Z (+ Z2 (* tana (- a) )))
(setq L (append L (list (in (rtos Z 2 3) p cao (angle p1 p2)) )))
)
(progn (setq Z (+ Z2 (* tana (+ a) )))
(setq L (append L (list (in (rtos Z 2 3) p cao (angle p1 p2)) )))
)
)
)
(command "point" p)
(setq i (1+ i))
);while
(COMMAND "LINE" P1 P2 "")
(if (> (cadr p1) (cadr p2))
(progn (mapcar '(lambda(x y)
(vla-put-textstring
(vla-get-textstring (vlax-ename->vla-object x)) y)
) L (reverse L) )))
(SETVAR "OSMODE" oldos)
(setq *error* temperr)
(princ)
)
;;;
(defun *error* (msg)
(princ "error: ")
(princ msg)
(princ)
)
;;;;;;;;;;;;;;;;
(defun bloi(errmsg)
(command "snap" "R" '(0 0 0) 0)
)
(defun in(txt p cao ang)
(while (> ang (/ pi 2))
(setq ang (- ang pi))
)
(entmakex (list(cons 0 "TEXT") (cons 1 txt) (cons 10 p) (cons 11 p) (cons 40 cao) (cons 50 ang)
(cons 72 1) (cons 73 1)
)
)
)



hihi. Được 80% rùi ạ. Còn cái lưu giá trị số phần tử nằm giữa AB thì e thua rùi. vì nó là getint ? help me !
<<

Filename: 175510_noisuy.lsp
Tác giả: VoHoan
Bài viết gốc: 226394
Tên lệnh: tam
Hỏi về Lisp (thuật toán, ý tưởng, coding,...)
Mình có viết lisp này đế xác định tâm của 1 hình kín, trước đây dùng bình thường giờ dùng lại thì bị báo lỗi này: "ActiveX Server returned the error: unknown name:
CENTROID"
Nhờ a e chỉ cách khắc phục với.

(defun c:tam ( / SS i ent P)
(vl-load-com)
(princ "\nChon cac doi tuong khep kin")
(setq SS (ssget)
i 0
)
(repeat (sslength SS)
(setq ent (ssname SS...
>>
Mình có viết lisp này đế xác định tâm của 1 hình kín, trước đây dùng bình thường giờ dùng lại thì bị báo lỗi này: "ActiveX Server returned the error: unknown name:
CENTROID"
Nhờ a e chỉ cách khắc phục với.

(defun c:tam ( / SS i ent P)
(vl-load-com)
(princ "\nChon cac doi tuong khep kin")
(setq SS (ssget)
i 0
)
(repeat (sslength SS)
(setq ent (ssname SS i)
P (vlax-safearray->list
(vlax-variant-value
(vlax-get-property
(vlax-ename->vla-object ent)
'Centroid
)
)
)
i (1+ i)
)
(command "CIRCLE" P 1)
)
(princ)
)

<<

Filename: 226394_tam.lsp
Tác giả: Doan Van Ha
Bài viết gốc: 224901
Tên lệnh: ha
[nhờ viết Code] Các bác viết giúp e code chọn đối tượng theo thứ tự vị trí trên Model
Lisp sắp xếp các đối tượng Text được chọn theo thứ tự X tăng dần. Nếu X bằng nhau thì sắp xếp theo Y giảm dần.

Filename: 224901_ha.lsp

Trang 117/330

117