Kumidan Posted July 19, 2010 Posted July 19, 2010 Hi, is there any site where I can find all Autocad commands and AutoLISP functions with the parameters they accept and an explanation for each parameter? In example if I search _text I'd like to find the command and all the parameter I can pass to it in a AutoLISP routine when I write something like (command "_text".....) Quote
The Buzzard Posted July 19, 2010 Posted July 19, 2010 In the Acad Help Section and Developer Help Sections. Quote
Lee Mac Posted July 19, 2010 Posted July 19, 2010 I realise that you may be a beginner, however I shall offer my opinion regardless: I personally would try to avoid the use of command statements and look to generate AutoCAD entities through the use of such functions as entmake or entmakex (or via the utilisation of an equivalent Visual Lisp method applied to a VLA Block Container Object). Command calls are not completely compatible across versions and are furthermore slow compared to those alternatives aforementioned. Should you wish to proceed to use command calls, I would offer some further advice: 1) be sure to prefix the command with "_." hence: (command "_.line" <point> <point> ") The underscore provides language compatibility and the dot will ensure the native command is invoked, in lieu of a possible user redefined command of the same syntax. Furthermore, be sure to prefix all menu options with an underscore for the reason stated above. In answer to your original question, I am not aware of the existence of such a reference (but I confess I avoid using the command function unless the alternative involves many hundreds of lines of code). When such time arises however, I would be inclined to manually invoke the command, execute the required task, meanwhile noting my actions. I hope my answer is adequate, if you have further questions, do not hesitate to ask. Regards, Lee Quote
Kumidan Posted July 20, 2010 Author Posted July 20, 2010 In the Acad Help Section and Developer Help Sections. Thanks. I've found for AutoLISP functions. For AutoCAD commands instead I've found the complete list in the help section, but it doesn't say for all the commands which parameters they need, for some commands is only explained what they do. Talking again about the example I wrote before, I've found this line inside a tutorial (command "_text" "90,40" "2.5" "" "Some text" "" "") but it is not explained, I can just imagine what those parameters are for, I'd also like to know which of those are required, which are optional... Replying to Lee, yes I'm new to autolisp Quote
MSasu Posted July 20, 2010 Posted July 20, 2010 The syntax and parameters are just the name of command, respectively his options - run the command on prompt and reproduce that dialog in your COMMAND function call. To explain your example: (command "_text" ;name of the command "90,40" ;insertion point coordinates "2.5" ;height of characters "" ;angle of text entity - accept default "Some text" ;the string that will be added "" ;NOT REQUIRED "") ;NOT REQUIRED However the above is equivalent with: (command "_text" ;name of the command '(90 40) ;insertion point coordinates 2.5 ;height of characters 0.0 ;angle of text entity - accept default "Some text") ;the string that will be added If you need some formatting to your text entity: (command "_text" ;name of the command "_justify" ;indicate that a formatting option follow "_MC" ;Middle-Center aligned '(90 40) ;insertion point coordinates 2.5 ;height of characters 0.0 ;angle of text entity - accept default "Some text") ;the string that will be added Regards, Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.