Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
jason.estas
Posts: 86
Registered: ‎01-08-2009
Message 21 of 30 (602 Views)

Re: Example of a typical room

01-17-2013 01:22 PM in reply to: pbejse

G'day,

 

I myself was after this very same lisp routine. But since I am not the best lisp creator I engaged the very one and only Lee Mac to write a program for me at a cost.

 

I have attached the program which he created for me as a kind of pay it forward situation.

 

Please do not modify the code in anyway and always leave Lee Mac at the Top.

 

Please enjoy as I know this little Lisp routine has help myself and my organization greatly.

 

Jasaon

*Expert Elite*
scot-65
Posts: 2,210
Registered: ‎12-11-2003
Message 22 of 30 (595 Views)

Re: Example of a typical room

01-17-2013 03:45 PM in reply to: mwhea

mwhea wrote:
...thought about wanting to add into it later on like ceiling tiles for instances where we cant just space our lights evenly but based on an actual grid tile setout point. 

Mwhea,

 

Attached files is what I showed earlier.

Giving more thought to the commercial (suspended ceilings) as well as residential,

I have developed the interface some more... Have a WIP look:

 

RLA02.gif

 

The LSP side of the above dialog has not been straightened out yet...

 

Scot-65

 

 

Scot-65
Dyslexia is a permanent physical disability that cannot be seen.
Introverts is proof that there is indeed intelligent life on this planet.
*Expert Elite*
scot-65
Posts: 2,210
Registered: ‎12-11-2003
Message 23 of 30 (566 Views)

Re: Example of a typical room

01-21-2013 03:30 PM in reply to: scot-65

REVISED, REWORKED, and STABILIZED.

 

Hopefully I have covered everything regarding light placement types for both Commercial and Residential.

The following interface is stabilized, and the help facility is developed, but not finished.

This is a working interface, the executing program is missing... Have a look.

 

RLA04.gif

 

Scot-65

 

 

Scot-65
Dyslexia is a permanent physical disability that cannot be seen.
Introverts is proof that there is indeed intelligent life on this planet.
Active Contributor
mwhea
Posts: 40
Registered: ‎09-04-2012
Message 24 of 30 (561 Views)

Re: Example of a typical room

01-21-2013 04:45 PM in reply to: jason.estas

Scot65,

 

From looking at your previous posts, the program you have made seems pretty in depth and would be very useful for companies (maybe post it serpately so more people may see it?) though in australia we use metric system so the imperial (inches) and what not doesn't work so much for us as we would be doing calculations all the time before inserting.

 

Mark 

*Expert Elite*
scot-65
Posts: 2,210
Registered: ‎12-11-2003
Message 25 of 30 (545 Views)

Re: Example of a typical room

01-22-2013 03:30 PM in reply to: mwhea

mwhea,

 

My brief taste into light layout included the required lumens value at floor level

based on the fixture output at the height specified above said floor level.

With this in mind one calculates the spacing between the lights. Stop here.

The interface begins where the spacing of the lights is known, and the

program will determine total number of fixtures in the given area.

Simple enough? (apologies if I did not understand you...)

 

Regarding metric, the executable part of the interface is not developed.

The interface can be reworded without much trouble to say CM or Meters...

Since I do not know "standard" Metric sizing's, I will leave this converting

up to you.

 

And Yes, this routine will be developed for our office. Production will

kneel at my feet and kiss the back of my hand when I release this...

Maybe they can each in turn buy me lunch for the next 3 months?

 

Scot-65   :-)

 

Scot-65
Dyslexia is a permanent physical disability that cannot be seen.
Introverts is proof that there is indeed intelligent life on this planet.
Valued Contributor
jason.estas
Posts: 86
Registered: ‎01-08-2009
Message 26 of 30 (529 Views)

Re: Example of a typical room

01-23-2013 06:13 PM in reply to: mwhea

mwhea,

 

Did you not see the lisp routine in my previous post? I too am from Australia and that program for which my company paid to get developed works a treat.

 

Let me know if it is what you are after!

 

Jason

New Member
Lexusmax
Posts: 2
Registered: ‎04-20-2014
Message 27 of 30 (184 Views)

Re: Example of a typical room

04-21-2014 12:13 AM in reply to: Kent1Cooper

You sir are a genius 

 

Is there any way to pick block directly on drawing instead to type the block name.

Could we choose the side of Rectangular instead we choose the corner of the Rectangular .

Please help me this master. I deeply need your help.

Please reply me via my email tltrung@secvn.com

 

Thank you very much.

 

Le Trung

*Expert Elite*
Kent1Cooper
Posts: 5,879
Registered: ‎09-13-2004
Message 28 of 30 (173 Views)

Re: Example of a typical room

04-21-2014 05:42 AM in reply to: Lexusmax

Lexusmax wrote:

You sir are a genius 

 

Is there any way to pick block directly on drawing instead to type the block name.

Could we choose the side of Rectangular instead we choose the corner of the Rectangular .

Please help me this master. I deeply need your help.

Please reply me via my email tltrung@secvn.com

 

Thank you very much.

 

Le Trung


Welcome to the Forums!

 

I assume you mean you want to select a Polyline rectangle along any side, since either choosing something like a Line or choosing two endpoints of a side would not provide enough information.  If it's a closed Polygon rectangle, this simple edit of the routine seems to work.

 

(defun C:arb (/ c1 c2 wid ht rows cols blk); = Lights in Rectangular [& orthogonal] Room
  (setq
    pl (car (entsel "\nSelect Polyline rectangle: "))
    c1 (cdr (assoc 10 (entget pl)))
    c2 (vlax-curve-getPointAtParam pl 2)
    wid (abs (- (car c1) (car c2)))
    ht (abs (- (cadr c1) (cadr c2)))
    rows (getint "\nNumber of rows (---): ")
    cols (getint "\nNumber of columns (|||): ")
    blk (cdr (assoc 2 (entget (car (entsel "\nSelect Block to Minsert: ")))))
  ); setq
  (command
    "_.minsert" blk
    (mapcar '+ ; insertion point
      (list (min (car c1) (car c2)) (min (cadr c1) (cadr c2))); lower left of room
      (list (/ wid cols 2) (/ ht rows 2)); fractions of width/height
    ); mapcar
    "" "" "" ; X, Y, rotation defaults -- edit if needed
    rows cols (/ ht rows) (/ wid cols); numbers and spacings
  ); command
  (princ)
); defun

 

But ideally, it should be more sophisticated.  It could be made to check whether you selected a Polyline rectangle and a Block, and it could use the usual error handling and other controls.  But see whether it does what you want.

Kent Cooper
New Member
Lexusmax
Posts: 2
Registered: ‎04-20-2014
Message 29 of 30 (154 Views)

Re: Example of a typical room

04-22-2014 08:16 PM in reply to: Kent1Cooper
Hi Kent1Cooper,

I am grateful for your response.
Now I attach the .lsp file and drawing showed the case.
The attached lisp is to determine effect area by choose 02 corners.
But I need to determine by select 04 edge (using object osnap) as attached
drawing.
Please adjust my lisp file and send back to me.

Thank you very much.

Le Trung
*Expert Elite*
Kent1Cooper
Posts: 5,879
Registered: ‎09-13-2004
Message 30 of 30 (143 Views)

Re: Example of a typical room

04-23-2014 04:26 AM in reply to: Lexusmax

[nothing attached...]

Kent Cooper
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.