hamidciv Posted September 26, 2014 Share Posted September 26, 2014 hi dear friends :(pleae help me for problem in easy code: (defun c:test4() (defun getpoly () (command "area" "object" ent) (getvar "perimeter") ) (setq ent (car(entsel))) ) Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted September 26, 2014 Share Posted September 26, 2014 (defun c:test4 () (setq ent (car (entsel))) (command "area" "object" ent) (getvar "perimeter") ) Quote Link to comment Share on other sites More sharing options...
hamidciv Posted September 26, 2014 Author Share Posted September 26, 2014 dear mostafa I mean this was not, i want define multiple function in one code and use them, similar to JefferyPSanders writen for addlength, Something like this: (defun c:test4 () ; ;;;--- Function to get the length of an ARC entity (defun getArc(en) (command "lengthen" en "") (getvar "perimeter") ) ;;;--- Function to get the length of a LINE entity (defun getLine(en) (setq enlist(entget en)) (distance (cdr(assoc 10 enlist)) (cdr(assoc 11 enlist))) ) ;;;--- Function to get the length of a POLY, CIRCLE, SPLINE, OR ELLIPSE (defun getPoly(en) (command "area" "Object" en) (getvar "perimeter") ) . . . . . ) Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted September 26, 2014 Share Posted September 26, 2014 maybe this help. [color=red](getPoly (car (entsel)))[/color] (defun getPoly(en) (command "area" "Object" en) (getvar "perimeter") ) Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted September 27, 2014 Share Posted September 27, 2014 mostafa, red line must be the last one... Order of loading functions is also important... M.R. Quote Link to comment Share on other sites More sharing options...
hamidciv Posted September 27, 2014 Author Share Posted September 27, 2014 (edited) :)thanks dear mostafa & marko my problem is solved. Edited September 27, 2014 by hamidciv Quote Link to comment Share on other sites More sharing options...
asos2000 Posted September 27, 2014 Share Posted September 27, 2014 Read this http://www.theswamp.org/index.php?topic=13046.msg158557#msg158557 Hoping gives an answer Quote Link to comment Share on other sites More sharing options...
hamidciv Posted September 27, 2014 Author Share Posted September 27, 2014 thanks asos for help me. Quote Link to comment Share on other sites More sharing options...
asos2000 Posted September 27, 2014 Share Posted September 27, 2014 thanks asos for help me. You are most welcome Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted September 27, 2014 Share Posted September 27, 2014 Oops thanks marko you right. the defun must be loaded firstly. mostafa, red line must be the last one... Order of loading functions is also important... M.R. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 28, 2014 Share Posted September 28, 2014 If you use VL you can Vl-get-area so will work for plines and circles also vl-get-length. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted September 29, 2014 Share Posted September 29, 2014 hamidciv, Please read the Code Posting Guidelines and edit your post to include the Code in Code Tags. Quote Link to comment Share on other sites More sharing options...
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.