+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Full Member
    Discipline
    Electrical
    Using
    AutoCAD 2016
    Join Date
    Apr 2017
    Posts
    56

    Default Electrical Panel Phase Balance Calculator LSP Lispertine

    Registered forum members do not see this ad.

    Okay, here's the deal. I need a LISP that calculates phase balance which is basically percent error between two numbers in the following form. However, we need it to take a selection and find the largest number, smallest number and make the following calculation, regardless of the numbers in the set.

    (Big - Small)/Big * 100 = X.X%

    Currently, we use an ADD.LSP which takes a selection and adds up the numbers. I am not familiar enough with the programming in order to take this relatively simple arithmetic and make it a working LSP.

    I have attached the ADD command if anyone is able to do something like this.

    add.LSP

    It should work by making a selection, then prompting the user to select where to place the phase balance (By adjusting the selected text to the updated value X.X%).

  2. #2
    Full Member
    Discipline
    Electrical
    Using
    AutoCAD 2016
    Join Date
    Apr 2017
    Posts
    56

    Default



    In the image above. This program, if I can ever get it to work, would work by selecting all three numbers, hitting spacebar and then selecting the number next to phase balance, and then hitting spacebar again.

  3. #3
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,504

    Default

    If you look in the lower right hand corner of the post you want to edit you should see the words Edit Post. Click on the phrase.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  4. #4
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,504

    Default

    Quote Originally Posted by ryankevin15 View Post
    That option is not available to me.
    Ah...the ten post minimum strikes again. Sorry.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  5. #5
    Super Member
    Using
    not applicable
    Join Date
    Jun 2016
    Posts
    588

    Default

    Try this:
    Code:
    (defun KGA_Conv_Pickset_To_ObjectList (ss / i ret)
      (if ss
        (repeat (setq i (sslength ss))
          (setq ret (cons (vlax-ename->vla-object (ssname ss (setq i (1- i)))) ret))
        )
      )
    )
    
    (defun c:PhaseBalance ( / ss numLst numMin numMax res trg)
      (if
        (and
          (princ "\nSelect source entities: ")
          (setq ss (ssget '((0 . "TEXT") (1 . "~*[~-.0-9]*") (1 . "~*`.*`.*") (1 . "~?*-*"))))
          (setq trg (car (entsel "\nSelect target entity: ")))
          (= "AcDbText" (vla-get-objectname (setq trg (vlax-ename->vla-object trg))))
        )
        (progn
          (setq numLst
            (mapcar
              '(lambda (obj) (read (vla-get-textstring obj)))
              (KGA_Conv_Pickset_To_ObjectList ss)
            )
          )
          (setq numMin (apply 'min numLst))
          (setq numMax (apply 'max numLst))
          ;; Formula: (Big - Small)/Big * 100 = X.X%
          (setq res (strcat (rtos (/ (- numMax numMin) numMax 0.01) 2 1) "%"))
          (princ (strcat "\nPhase Balance: "  res))
          (vla-put-textstring trg res)
        )
      )
      (princ)
    )
    BricsCAD 16

  6. #6
    Full Member
    Discipline
    Electrical
    Using
    AutoCAD 2016
    Join Date
    Apr 2017
    Posts
    56

    Default

    Can you make one that takes a total wattage from a panel and divides it by 360 to find the amperage? I'd call it like 360 or something. Wow, still very amazed that you coded that!

  7. #7
    Full Member
    Discipline
    Electrical
    Using
    AutoCAD 2016
    Join Date
    Apr 2017
    Posts
    56

    Default

    Roy_043,

    Could you potentially make a lisp that takes a value (total demand in Watts) and divide by 360 for 208V for total demand amps? Also, when using 480V we divide by 831. These two lisps will make things much quicker. And also, in the phase balance lips, is there any rounding applied to that value? Did you make the phase balance one yourself or just happened to already have it?
    Last edited by ryankevin15; 26th Apr 2017 at 03:07 pm.

  8. #8
    Senior Member
    Using
    not applicable
    Join Date
    Oct 2014
    Posts
    151

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by ryankevin15 View Post
    Roy_043,

    Could you potentially make a lisp that takes a value (total demand in Watts) and divide by 360 for 208V for total demand amps? Also, when using 480V we divide by 831. These two lisps will make things much quicker. And also, in the phase balance lips, is there any rounding applied to that value? Did you make the phase balance one yourself or just happened to already have it?
    If you just want to change the decimal place accuracy of the output, take a look at the RTOS function in Roy_043's code.

    http://ronleigh.com/autolisp/afude12.htm#rtos

Similar Threads

  1. BIM - MEP Coordination (construction phase)
    By yrnomad in forum Revit MEP
    Replies: 21
    Last Post: 26th Aug 2016, 03:07 pm
  2. Single Phase Panel Schedule Issue
    By -KarL- in forum Revit MEP
    Replies: 4
    Last Post: 19th Aug 2014, 11:28 pm
  3. Dual Icon menu panel, AutoCAD Electrical 2012
    By Xpeter88 in forum Electrical
    Replies: 1
    Last Post: 2nd Nov 2012, 12:13 pm
  4. Structural Housing of Electrical panel
    By lulumara in forum AutoCAD General
    Replies: 12
    Last Post: 1st Mar 2012, 09:26 pm
  5. MEP-Electrical Panel schedules (HELP)
    By TXGABE in forum MEP
    Replies: 2
    Last Post: 5th Nov 2008, 02:39 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts