Summary of the invention
The embodiment of the invention has been developed Chinese order for the difficulty that solves operation interface among the existing AutoCAD and Chinese user's ability to accept based on the command library of VisualLisp language, has realized the simple and easy degree of Chinese operation interface and has simplified development difficulty.
Based on above-mentioned purpose, it is a kind of based on the compiling of the Chinese under VisualLisp programming language implementation method that the embodiment of the invention provides, and described method comprises:
Chinese function library and cmi code interpreter are set in the VisualLisp command library;
Receive the operational order of operation user input based on the visualization window of AutoCAD;
Based on Chinese function library and cmi code interpreter the operational order of input is carried out process of compilation;
Result after the process of compilation is shown to the operation user.
Describedly in the VisualLisp command library, Chinese function library is set and the cmi code interpreter comprises: the Chinese order storehouse that the cmi code interpreter can be supported is set; And the corresponding Chinese function library of each Chinese order.
Describedly based on Chinese function library and cmi code interpreter the operational order of input is carried out process of compilation and comprise: the operational order to described input is identified judgement, when if described operational order is resolved by the cmi code interpreter, then call corresponding Chinese function library described operational order is carried out process of compilation; When if described operational order can not be resolved by the cmi code interpreter, then prompting user input error.
Accordingly, it is a kind of based on the compiling implementation method under the VisualLisp programming language that the embodiment of the invention also provides, and described method comprises:
Chinese function library and cmi code interpreter are set in the VisualLisp command library;
Receive the operational order of operation user input based on the visualization window of AutoCAD;
Judge the residing translation and compiling environment of described operational order;
If judging described operational order is Chinese translation and compiling environment, then based on Chinese function library and cmi code interpreter the operational order of input is carried out process of compilation; If judging described operational order is English translation and compiling environment, then based on English function library and English code interpretative device the operational order of input is carried out process of compilation;
Result after the process of compilation is shown to the operation user.
Describedly in the VisualLisp command library, Chinese function library is set and the cmi code interpreter comprises: the Chinese order storehouse that the cmi code interpreter can be supported is set; And the corresponding Chinese function library of each Chinese order.
Describedly based on Chinese function library and cmi code interpreter the operational order of input is carried out process of compilation and comprise: the operational order to described input is identified judgement, when if described operational order is resolved by the cmi code interpreter, then call corresponding Chinese function library described operational order is carried out process of compilation; When if described operational order can not be resolved by the cmi code interpreter, then prompting user input error.
Accordingly, the invention process example also provides a kind of and has realized system based on the compiling under the VisualLisp programming language, and described system comprises:
The command set module is used at the VisualLisp command library Chinese function library and cmi code interpreter being set;
VisualLisp command library module is used for Chinese function library and cmi code interpreter that storage arranges;
Load module is used for receiving the operational order that the operation user inputs based on the visualization window of AutoCAD;
Collector, the Chinese function library and the cmi code interpreter that are used for storing based on VisualLisp command library module carry out process of compilation to the operational order of input;
Display module is used for the result after the collector institute process of compilation is shown to the operation user.
Described command set module is used for the Chinese order storehouse that the cmi code interpreter can be supported is set, and the corresponding Chinese function library of each Chinese order.
Described collector also is used for the operational order of described input is identified judgement, if when described operational order is resolved by the cmi code interpreter, then calls corresponding Chinese function library Chinese order is carried out process of compilation; When if described operational order can not be resolved by the cmi code interpreter, then prompting user input error.
Accordingly, the embodiment of the invention also provides a kind of and has realized system based on the compiling under the VisualLisp programming language, and described method comprises:
The command set module is used at the VisualLisp command library Chinese function library and cmi code interpreter being set;
VisualLisp command library module is used for Chinese function library and cmi code interpreter that storage arranges;
Load module is used for receiving the operational order that the operation user inputs based on the visualization window of AutoCAD;
The environment identification module is used for judging the residing translation and compiling environment of described operational order;
The first collector is used for after the environment identification module judges that described operational order is Chinese translation and compiling environment, based on Chinese function library and cmi code interpreter the operational order of input is carried out process of compilation;
The second collector is used for after the environment identification module judges that described operational order is English translation and compiling environment, based on English function library and English code interpretative device the operational order of input is carried out process of compilation;
Display module is used for the result after the first collector or the second collector institute process of compilation is shown to the operation user.
Described command set module is used for the Chinese order storehouse that the cmi code interpreter can be supported is set, and the corresponding Chinese function library of each Chinese order.
Described collector also is used for the operational order of described input is identified judgement, if when described operational order is resolved by the cmi code interpreter, then calls corresponding Chinese function library Chinese order is carried out process of compilation; When if described operational order can not be resolved by the cmi code interpreter, then prompting user input error.
By implementing the embodiment of the invention, Chinese function library and cmi code interpreter are write in the basis take former English edition as substrate, have realized the Chinese Lisp programming language that new grammer is simple and with better function.Only need to pay close attention to writing of Chinese language concerning the user, need not to comprehend the interpretation process of cmi code, this interpretation process realizes by the backstage compile mode.More easy to learn than existing any AutoCAD related development language, can use Chinese language to programme, give up the grammatical manner of English edition flashback, more meet Chinese's custom, learning cycle shortens greatly, and Chinese language is more easily accepted, and effectively saves learning cost.The English function performance of Chinese function ratio is more powerful, function library is abundanter, in short finishes the action of English edition multirow code, and English edition needs self-defining function, and Chinese edition directly provides.Greatly save the scramble time, save cost.System development is based on the AutoCAD platform, and user's use is installed identical with former English Lisp programming language, uses to load the loading that the Lisp program command can be finished Chinese programming interpreter in AutoCAD.The user can use the editing machine of former English edition equally in when programming, and command recognition that can Chinese and English married operation, also convenient traditional operation user.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
The embodiment of the invention is the basis take former English edition as substrate, writes Chinese function library and cmi code interpreter, has realized the Chinese Lisp programming language that new grammer is simple and with better function.Below the content in the embodiment of the invention is made specific description.
Fig. 1 show in the embodiment of the invention based on the Chinese under VisualLisp programming language compiling implementation method process flow diagram, comprise the steps:
S101: Chinese function library and cmi code interpreter are set in the VisualLisp command library;
The Chinese order storehouse that the cmi code interpreter can be supported is set; And the corresponding Chinese function library of each Chinese order.
S102: the operational order that receives operation user input based on the visualization window of AutoCAD;
S103: the operational order of input is carried out process of compilation based on Chinese function library and cmi code interpreter;
Operational order to input is identified judgement, if when this operational order is resolved by the cmi code interpreter, then calls corresponding Chinese function library described operational order is carried out process of compilation; When if this operational order can not be resolved by the cmi code interpreter, then prompting user input error.
S104: the result after the process of compilation is shown to the operation user.
Need to prove, here carry out the input of AutoCAD order with Chinese development interface support operation user, at first by corresponding Chinese development environment and translation and compiling environment are set in the VisualLisp command library, can make the Chinese order of input support the backstage process of compilation, thereby simplify Chinese character user's operability.Further, when operational order is original english command, in the situation that this cmi code interpreter and Chinese function library are not identified, can the prompting user input error; When perhaps Chinese translation and compiling environment is not resolved operational order, can send to operational order in the translation and compiling environment of english command, carry out process of compilation based on English code interpretative device and English function library, if energy process of compilation, then the result after the process of compilation is shown to the operation user, but otherwise prompting user input error.
Fig. 2 shows and realizes the system architecture schematic diagram based on the compiling under the VisualLisp programming language in the embodiment of the invention, comprises as follows:
Command set module 201 is used at the VisualLisp command library Chinese function library and cmi code interpreter being set;
VisualLisp command library module 202 is used for Chinese function library and cmi code interpreter that storage arranges;
Load module 203 is used for receiving the operational order that the operation user inputs based on the visualization window of AutoCAD;
Collector 204 is used for based on Chinese function library and the cmi code interpreter of 202 storages of VisualLisp command library module the operational order of input being carried out process of compilation;
Display module 205 is used for the result after the collector institute process of compilation is shown to the operation user.
Need to prove, the command set module 201 here is used for the Chinese order storehouse that the cmi code interpreter can be supported is set, and the corresponding Chinese function library of each Chinese order.The collector 204 here also is used for the operational order of input is identified judgement, if when this operational order is resolved by the cmi code interpreter, then calls corresponding Chinese function library Chinese order is carried out process of compilation; When if this operational order can not be resolved by the cmi code interpreter, then prompting user input error.
Need to prove, here carry out the input of AutoCAD order with Chinese development interface support operation user, at first the developer can arrange corresponding Chinese development environment and translation and compiling environment by command set module 201 in the VisualLisp command library, can make the Chinese order of input support the backstage process of compilation, thereby simplify Chinese character user's operability.Further, the command set module 201 here can be supported Chinese and English mixed developing simultaneously, store in the VisualLisp command library module 202 outside Chinese function library and the cmi code interpreter, also have English function library and should be your code interpretative device, when operational order is original english command, in the situation that this cmi code interpreter and Chinese function library are not identified, can the prompting user input error; When perhaps Chinese translation and compiling environment is not resolved operational order, collector 204 can be called in the translation and compiling environment of english command, carry out process of compilation based on English code interpretative device and English function library, if energy process of compilation, then the result after the process of compilation is shown to the operation user, but otherwise prompting user input error.
Fig. 3 show in the embodiment of the invention based on the compiling implementation method process flow diagram under the VisualLisp programming language, comprise the steps:
S301: Chinese function library and cmi code interpreter are set in the VisualLisp command library;
Need to prove, in order to satisfy Chinese character operator's demand, can develop Chinese function library and cmi code interpreter based on existing VisualLisp programming language, be used for realizing operating the input of user's Chinese order.Here also keep traditional English development environment, also can receive traditional user's hobby, received the input of english command.The developer need to arrange the Chinese order storehouse that the cmi code interpreter can be supported when command set; And the corresponding Chinese function library of each Chinese order.
S302: the operational order that receives operation user input based on the visualization window of AutoCAD;
The operational order here can be Chinese order, also can be english command, and system supports the input of two kinds of orders simultaneously
S303: the residing translation and compiling environment of decision operation order, if when identifying the residing translation and compiling environment of operational order for Chinese, then send to S304, if when identifying the residing translation and compiling environment of operational order for English, then send to S305;
S304: the operational order of input is carried out process of compilation based on Chinese function library and cmi code interpreter;
Further, specifically comprise in this step: the operational order to input is identified judgement, if when operational order is resolved by the cmi code interpreter, then calls corresponding Chinese function library operational order is carried out process of compilation; When if operational order can not be resolved by the cmi code interpreter, then prompting user input error.
S305: the operational order of input is carried out process of compilation based on English function library and English code interpretative device;
S306: the result after the process of compilation is shown to the operation user.
Need to prove, in original system, increase Chinese translation and compiling environment here, carry out the input of AutoCAD order with Chinese development interface or English development interface support operation user.Because original english command storehouse exists, at first by corresponding Chinese development environment and translation and compiling environment are set in the VisualLisp command library, can make the Chinese order of input support the backstage process of compilation, thereby simplify Chinese character user's operability.Receive order when input of operation user in system, the identification translation and compiling environment is realized process of compilation and the output of ordering thereby call corresponding translation and compiling environment.
Fig. 4 shows and realizes another structural representation of system based on the compiling under the VisualLisp programming language in the embodiment of the invention, comprises as follows:
Command set module 401 is used at the VisualLisp command library Chinese function library and cmi code interpreter being set;
VisualLisp command library module 402 is used for Chinese function library and cmi code interpreter that storage arranges;
Load module 403 is used for receiving the operational order that the operation user inputs based on the visualization window of AutoCAD;
Environment identification module 404 is used for judging the residing translation and compiling environment of described operational order;
The first collector 405 is used for after the environment identification module judges that described operational order is Chinese translation and compiling environment, based on Chinese function library and cmi code interpreter the operational order of input is carried out process of compilation;
The second collector 406 is used for after the environment identification module judges that described operational order is English translation and compiling environment, based on English function library and English code interpretative device the operational order of input is carried out process of compilation;
Display module 407 is used for the result after the first collector or the second collector institute process of compilation is shown to the operation user.
The command set module 401 here is used for the Chinese order storehouse that the cmi code interpreter can be supported is set, and the corresponding Chinese function library of each Chinese order.The collector here also is used for the operational order of described input is identified judgement, if when described operational order is resolved by the cmi code interpreter, then calls corresponding Chinese function library Chinese order is carried out process of compilation; When if described operational order can not be resolved by the cmi code interpreter, then prompting user input error.
Further need to prove, in original system, increase Chinese translation and compiling environment here, carry out the input of AutoCAD order with Chinese development interface or English development interface support operation user.Because original english command storehouse exists, at first by corresponding Chinese development environment and translation and compiling environment are set in the VisualLisp command library, can make the Chinese order of input support the backstage process of compilation, thereby simplify Chinese character user's operability.Receive order when input of operation user in system, the identification translation and compiling environment is realized process of compilation and the output of ordering thereby call corresponding translation and compiling environment.
Fig. 5 and Fig. 6 show the operational applications environment in the embodiment of the invention, and the operational order of Fig. 5 is as follows:
Carry out one (revising (single choice) " color "=2)
Select first a round dot to hit and to finish the figure modification.
The operational order of Fig. 6 is as follows:
Carry out one (revising (multiselect) " color "=3)
Selecting first a plurality of figures to confirm to finish figure revises.
To sum up, by implementing the present invention, Chinese function library and cmi code interpreter are write in the basis take former English edition as substrate, have realized the Chinese Lisp programming language that new grammer is simple and with better function.Only need to pay close attention to writing of Chinese language concerning the user, need not to comprehend the interpretation process of cmi code, this interpretation process realizes by the backstage compile mode.More easy to learn than existing any AutoCAD related development language, can use Chinese language to programme, give up the grammatical manner of English edition flashback, more meet Chinese's custom, learning cycle shortens greatly, and Chinese language is more easily accepted, and effectively saves learning cost.The English function performance of Chinese function ratio is more powerful, function library is abundanter, in short finishes the action of English edition multirow code, and English edition needs self-defining function, and Chinese edition directly provides.Greatly save the scramble time, save cost.System development is based on the AutoCAD platform, and user's use is installed identical with former English Lisp programming language, uses to load the loading that the Lisp program command can be finished Chinese programming interpreter in AutoCAD.The user can use the editing machine of former English edition equally in when programming, and command recognition that can Chinese and English married operation, also convenient traditional operation user.
Above compiling implementation method and the system based under the VisualLisp programming language that the embodiment of the invention is provided is described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.