Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

LISP Routine that circuits Light fixtures with an Arc

Anonymous

LISP Routine that circuits Light fixtures with an Arc

Anonymous
No aplicable

I current have a LISP that will create an arc from one to another from the center of the fixture and will trim the arc within the circle of each fixture. Currently it only allows you to do one to the other but I often have multiple rows and it would be nice to select the first one thru the last one and it will do the same with each fixture in that row.

 

Any thoughts?

0 Me gusta
Responder
1.803 Vistas
5 Respuestas
Respuestas (5)

pendean
Community Legend
Community Legend
Upgrade to AutoCAD Electrical: does that natively and as a core feature all day long.

Or post in the LISP forum way over here http://forums.autodesk.com/t5/autocad-customization/ct-p/AutoCADTopic1
0 Me gusta

Anonymous
No aplicable

try this LISP it the prompt name is "MLFA" it asks what radius you want for the arc, then you drawing your circuit. works for lighting and power.  Side effects i have noticed is it turns your snaps off occationally.  

 

;; MultiLineFilletAlong.lsp [command name: MLFA]
;; To draw Multiple sequential Lines and Fillet the corners Along the way.
;; User specifies non-zero Fillet radius [offers current radius as default if non-zero].
;; Turns Ortho on for right-angle corners, but can be edited to not do so, and/or
;; User can turn it off or on during routine.
;; Notifies User if any combination of Lines cannot be Filleted at current radius;
;; check designed for right angles, so may not always work if non-orthogonal.
;; Draws on the current Layer.
;; Kent Cooper, 13 June 2013

(defun C:MLFA ; = Multiple Lines, Filleted Along the way
(/ *error* *fr *len cmde orth lin1 lin2)

(defun *error* (errmsg)
(if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
(prompt (strcat "\nError: " errmsg))
); if
(setvar 'orthomode orth) ;; delete or comment out if not desired
(command "_.undo" "_end")
(setvar 'cmdecho cmde)
(princ)
); defun - *error*

(defun *fr () (getvar 'filletrad))

(defun *len (lin); long enough for Fillet radius? [appropriate for right-angle corners only]
(>= (vlax-curve-getEndParam lin) (getvar 'filletrad))
); defun

(setq
cmde (getvar 'cmdecho)
orth (getvar 'orthomode) ;; delete or comment out if not desired
); setq
(setvar 'cmdecho 0)
(command "_.undo" "_begin" "_.ortho" "on") ;; delete last two words if not desired

(initget (if (= (*fr) 0) 7 6)); no 0, no negative, no Enter if FILLETRAD=0
(setvar 'filletrad
(cond
((getdist
(strcat
"\nNon-zero Fillet radius"
(if (= (*fr) 0) "" (strcat " <" (rtos (*fr)) ">")); current as option only if non-zero
": "
); strcat
); getdist
); User-specified-radius condition
((*fr)); keep current value on User Enter if non-zero
); cond
); setvar

(prompt "\nTo draw sequence of Lines to Fillet,")
(command "_.line" pause pause "")
(setq lin1 (entlast))
(while (setq pt (getpoint (getvar 'lastpoint) "\nNext point: "))
(command "_.line" "@" pt "")
(setq lin2 (entlast))
(if (and (*len lin1) (*len lin2))
(command "_.fillet" lin1 lin2); then
(prompt "\nLine(s) not long enough."); else
); if
(setq lin1 lin2); last Line becomes first for next Fillet
); while

(setvar 'orthomode orth) ;; delete or comment out if not desired
(command "_.undo" "_end")
(setvar 'cmdecho cmde)
(princ)

); defun
(vl-load-com)
(prompt "\nType MLFA to draw Multiple Lines Filleted Along the way.")

0 Me gusta

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

I current have a LISP that will create an arc from one to another from the center of the fixture and will trim the arc within the circle of each fixture. Currently it only allows you to do one to the other but I often have multiple rows and it would be nice to select the first one thru the last one and it will do the same with each fixture in that row.

....


I've contributed some things to threads on such topics, some of which you've been a participant in, but there are different approaches from other people on them, too.  Can you post the routine you're using?  It may be comparatively simple to adjust it.

 

Are you willing to select them by picking one at a time in order [more trouble for the User, but much simpler code for the Arc creation], or would you want to select a whole row, for example by Window [simpler for the User, but more complicated code to determine the order]?

Kent Cooper, AIA
0 Me gusta

Anonymous
No aplicable

hi kent 

 

i would like to ask some question about lighting fixtures for electrical. i want to create lighting fixture for one room. my question is i have so many lighting fixtures block .i wish that lisp to ask (select room dimension, no of column, no of row, column spacing, row spacing, pick block, block visibility, then ok)

have you any lisp like that. if you had lisp like this. 

 

kindly send. i am waiting your great response.

 

thanks 

 

hussain

0 Me gusta

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

... .i wish that lisp to ask (select room dimension, no of column, no of row, column spacing, row spacing, pick block, block visibility, then ok)

have you any lisp like that.....


I don't have anything exactly like that, but I wonder about some things....

 

if you're going to give it the number and spacing of both rows and columns, it seems to me that ARRAY or MINSERT would do almost all of that for you, without any custom routine.

 

If it asks for all four of those things, the room dimension wouldn't have any influence.  So maybe you want something more like this routine.  It's about sprinkler heads, and it has a maximum spacing between heads, from which and the room dimension it calculates the number required in one direction and the actual spacing.  And it has a maximum coverage area per sprinkler head, from which and the actual spacing in the first direction and the room dimension, it calculates the number and spacing in the other direction.  Would something like that work for light fixtures, if their lumen output and the required light level can be used to define a maximum spacing and maximum coverage area?  That routine could be modified pretty easily for that kind of application.

Kent Cooper, AIA
0 Me gusta