CAD中LISP程序使用方法.docx
《CAD中LISP程序使用方法.docx》由会员分享,可在线阅读,更多相关《CAD中LISP程序使用方法.docx(19页珍藏版)》请在冰豆网上搜索。
![CAD中LISP程序使用方法.docx](https://file1.bdocx.com/fileroot1/2023-1/5/f0c96ac4-2945-4811-8508-5e7ecaaee057/f0c96ac4-2945-4811-8508-5e7ecaaee0571.gif)
CAD中LISP程序使用方法
CAD中LISP程序使用方法
2007-08-0619:
13:
32|分类:
学习园地|字号订阅
1.对于提供附件下载的,把附件下载就可以了
2.对于提供的源LISP代码,把代码拷贝、粘贴到一个文件,自己起个名或者若程序里面注释推荐了文件名,就用推荐的,然后保存成扩展名是LSP的文件即可了。
LISP程序使用方法:
加载LISP
1.可以使用APPLOAD命令,然后去找到要加载的LISP文件,加载即可。
2.可以自己从文件管理器把LISP文件拖动到ACAD的图形窗口,也可以加载
3.在命令行后用,(load"c:
\\temp\\xxx.lsp")也可以加载,路径名请输入实际的路径。
另:
对于一个LSP程序,(defun后面的既是命令或者函数,一般程序应该有提示,若没有,标志符c:
后面的单词是可以在ACAD下使用的命令,既可以在COMMAND:
后面直接输入,即可执行。
CAD快速切换图层LISP代码(方法2)
给楼主发一个图层更改的lisp程序,按对应数字键就可以切换到相应的图层。
很方便。
0————0
1————OBJ
2————6t
3————SCETR
。
。
。
8————BORDER
如果这些不是你想要的图层,将lisp用笔记本打开,把里边的OBJ,6t等图层名改为你想要的就可以了。
以后要切换图层时,按相应的数字键即可。
(defunYH_chlayer(YH_layer/YH_S)
(if(null(tblsearch"LAYER"YH_layer))
(entmake(list
'(0."LAYER")
'(100."AcDbSymbolTableRecord")
'(100."AcDbLayerTableRecord")
(cons2YH_layer);图层名称
'(70.0);图层状态
'(62.7);图层颜色
'(6."bylayer");图层线型)
)
)
(setqYH_S(cadr(ssgetfirst)))(ifYH_S
(command"CHPROP"YH_S"""la"YH_layer"c""bylayer""")
(setvar"clayer"YH_layer)
)
(princ)
)
(defunc:
0()
(YH_chlayer"0")
)
(defunc:
1()
(YH_chlayer"OBJ")
)
(defunc:
2()
(YH_chlayer"6t")
)
(defunc:
3()
(YH_chlayer"SCETR")
)
(defunc:
4()
(YH_chlayer"HIDD")
)
(defunc:
5()
(YH_chlayer"DIM")
)
(defunc:
6()
(YH_chlayer"DASH")
)
(defunc:
7()
(YH_chlayer"TEXT")
)
(defunc:
8()
(YH_chlayer"BORDER"))
#Cad
到上面一行为址,保存为lsp格式。
LISP小程序,改变对象颜色;;数字1
(defunC:
1(/gp)(setvar"cmdecho"0)(princ"\n?
改变对象颜色为红色?
")(setqgp(ssget))(if(/=gpnil)(command".change"gp"""p""c""1"""))
(princ"\nOK")
(princ)
);enddefunC:
1
;;数字2
(defunC:
2(/gp)(setvar"cmdecho"0)(princ"\n?
改变对象颜色为黄色?
")(setqgp(ssget))(if(/=gpnil)(command".change"gp"""p""c""2"""))
(princ"\nOK")
(princ)
);enddefunC:
2
;;数字3
(defunC:
3(/gp)(setvar"cmdecho"0)(princ"\n?
改变对象颜色为绿色?
")(setqgp(ssget))(if(/=gpnil)(command".change"gp"""p""c""3"""))
(princ"\nOK")
(princ)
);enddefunC:
3
;;数字4
(defunC:
4(/gp)(setvar"cmdecho"0)
(princ"\n?
改变对象颜色为青色?
")(setqgp(ssget))(if(/=gpnil)(command".change"gp"""p""c""4"""))
(princ"\nOK")
(princ)
);enddefunC:
4
;;数字5
(defunC:
5(/gp)(setvar"cmdecho"0)(princ"\n?
改变对象颜色为蓝色?
")(setqgp(ssget))(if(/=gpnil)(command".change"gp"""p""c""5"""))
(princ"\nOK")
(princ)
);enddefunC:
5
;;数字6
(defunC:
6(/gp)(setvar"cmdecho"0)(princ"\n?
改变对象颜色为紫色?
")(setqgp(ssget))(if(/=gpnil)(command".change"gp"""p""c""6"""))
(princ"\nOK")
(princ)
);enddefunC:
6
;;数字7
(defunC:
7(/gp)(setvar"cmdecho"0)(princ"\n?
改变对象颜色为白色?
")(setqgp(ssget))(if(/=gpnil)(command".change"gp"""p""c""7"""))
(princ"\nOK")
(princ)
);enddefunC:
7
;;数字8
(defunC:
8(/gp)(setvar"cmdecho"0)(princ"\n?
改变对象颜色为深灰色?
")(setqgp(ssget))(if(/=gpnil)(command".change"gp"""p""c""8"""))
(princ"\nOK")
(princ)
);enddefunC:
8
;;数字9
(defunC:
9(/gp)
(setvar"cmdecho"0)
(princ"\n?
改变对象颜色为灰色?
")
(setqgp(ssget))
(if(/=gpnil)(command".change"gp"""p""c""9"""))
(princ"\nOK")
(princ)
);enddefunC:
9
(英文版)
Tworegulationspromulgatedforimplementationisinthepartyinpowerforalongtimeandtheruleoflawconditions,theimplementationofcomprehensivestrictlystrategicplan,implementationinaccordancewiththerulesanddisciplinetomanagetheparty,strengtheninner-partysupervisionofmajorinitiatives.Thetworegulationssupportingeachother,theadheretoapositiveadvocate,focusingonmoralityisofPartymembersandPartyleadingcadrescansee,enoughtogetahighstandard;aroundthepartydiscipline,disciplinaryrulerrequirements,listedas"negativelist,focusingonverticalgauge,drawthepartyorganizationsandPartymembersdonottouchthe"bottomline".Here,themainfromfoursquarefacetwopartyrulesofinterpretation:
thefirstpartintroducestwopartyRevisedregulationsthenecessityandtherevisionprocess;thesecondpartistheinterpretationofthetwofundamentalprinciplesoftherevisionoflawsandregulationsintheparty;thethirdpartintroducestwopartyregulationsmodifiedthemainchangesandneedstograspseveralkeyproblems;thefourthpartonhowtograsptheimplementationofthetworegulationsoftheparty.andrevisedthenecessityandrevisedhistoryoftheCPCCentralCommitteetheamendmenttotheChineseCommunistPartymembersandleadingcadreshonestpoliticsseveralguidelines>andcolumn1by2015tostrengthen
partylawsandregulationsfocus.TwopartyregulationsrevisionworklastedaYears,poolingthewisdomofthewholeparty,ideologicalconsensus,drawhistoricalexperience,respectforthewisdomofourpredecessors,whichreflectstheunityofinheritanceandinnovation;followthecorrectdirection,graspthelimitedgoals,adheretotheparty'sleadership,tosolvethemassesofthepeoplereflectafocusontheproblem.Thenewrevisionoftheand,reflectstheparty's18andtheeighthsessionofthethird,thespiritofthefourthplenarysession,reflectingtheexperienceofstudyingandimplementingtheGeneralSecretaryXiJinpingseriesofimportantspeech,reflectstheparty'seighteenyearscomprehensivestrictlypractice.(a)revisedtworegulationsofthepartyneedofinbasedonrevised,thepromulgationandimplementationofJanuary2010,tostrengthentheconstructionofthecontingentofleadingcadresplayanimportantrole.Butwiththepartytomanagethepartystrictlyadministeringthedeepening,hasnotbeenabletofullymeettheactualneeds.Contentistoocomplicated,"eightprohibition,52arenotallowedto"hardtoremember,andalsodifficulttoputintopractice;thesecondisconciselypositiveadvocatedbythelackofprohibitedprovisionsexcessive,noautonomyrequirements;thethirdisbannedtermsanddisciplinelaw,bothwiththepartydiscipline,disciplinaryregulations
repeatandCriminallawandotherlawsandregulationsrepeat;thefourthisto"clean"thethemeisnotprominent,notfortheexistingproblems,andisnarrow,onlyneedleofcounty-levelleadingcadresabove.isin1997basedonrevision,inDecember2003thepromulgationandimplementation,tostrengthentheconstructionofthepartyplayveryimportantrole.Alongwiththedevelopmentofthesituation,whichmanyprovisionshavebeenunabletofullymeetthecomprehensivestrictlyadministeringthepracticeneeds.OneisJilaw,morethanhalfoftheprovisionsandcriminallawandothercountrieslawsandregulationsRepetition;twoisthepoliticaldisciplineregulationsisnotprominent,notspecific,forviolationofthepartyconstitution,damagetheauthorityofPartyConstitutionofmisconductlacknecessaryandseriousresponsibilitytopursue;thirdisthemaindisciplinefortheleadingcadres,doesnotcoverallPartymembers.Basedontheabovesituation,needtoandthetwoislikelytobemorerelevantregulationsfirstamendment.Byrevising,reallyputtheauthorityofPartydiscipline,theseriousnessinthepartytreeandcallupthemajorityofPartymembersandcadresofthepartyconstitutionofpartycompassespartyconsciousness.(II)twopartyregulationsrevisionprocesstheCentralCommitteeoftheCommunistPartyofChinaattachesgreatimportancetotworegulationsrevision.XiJinping,generalbooksrecordedintheFifth
PlenarySessionoftheeighthsessionoftheCentralCommissionforDisciplineInspection,ontherevisedregulations<>madeclearinstructions.Accordingtothecentraldeployment,theCentralCommissionforDisciplineInspectionfrom2014undersixmonthsbeginstudytworegulationsrevision.TheStandingCommitteeoftheCentralCommissionforDisciplineInspection4reviewrevised.ComradeWangQishan14timesheldaspecialmeetingtostudytworegulationsrevision,amendmentclarifiesthedirection,majorissuesofprinciple,pathandtarget,respectivelyheldaforumwilllistentopartoftheprovince(area)secretaryofthePartycommittee,SecretaryoftheDisciplineInspectionCommission,partofthecentralministriesandstateorgansDepartment
Thefirstpartycommitteeismainlyresponsibleforpeople,viewsofexpertsandscholarsandgrassrootspartyorganizationsandPartymembers.ApprovedbytheCentralCommitteeoftheCommunistPartyofChina,on7September2015,thegeneralofficeoftheCentralCommitteeofthePartyissuedanoticetosolicittheprovinces(autonomousregions,municipalities)Party,thecentralministriesandcommissions,stateministriesandcommissionsoftheParty(party),theGeneralPoliticalDepartmentofthemilitary,every3peopleorganizationofPartyoftworegulationsrevisionopinion.CentralCommissionforDisciplineInspectionofextensivesolicitationofopinions,carefulstudy,attracting,formedarevisedsentreviewers.InOctober8andOctober12,CentralCommitteePolitical
BureauStandingCommitteeandthePoliticalBureauoftheCentralCommitteeAfterconsiderationofthetworegulationsreviseddraft.OnOctober18,theCentralCommitteeoftheCommunistPartyofChinaformallyissuedtworegulations.Cansay,twolawsamendmentconcentratedthewisdomofthewholeparty,embodiestheparty.Second,andrevisionofthebasicprinciplesoftwopartyregulationsrevisionworkandimplementthepa