Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/22/2021 in all areas

  1. It could be something like this: (defun C:HT (/ ctextc sset index area obj) (defun ctextc (stringa / html result) (if (= (type stringa) 'STR) (progn (setq html (vlax-create-object "htmlfile") result (vlax-invoke (vlax-get (vlax-get html 'ParentWindow) 'ClipBoardData) 'setData "Text" stringa ) ) (vlax-release-object html) result ) nil ) ) (if (>= (atof (substr (getvar "acadver") 1 4)) 16.2) (progn (prompt "\nSelect hatches: ") (if (setq sset (ssget '((0 . "HATCH")))) (progn (setq area 0) (repeat (setq index (sslength sset)) (setq obj (vlax-ename->vla-object (ssname sset (setq index (1- index)))) area (+ area (vla-get-area obj)) ) ) ) ) ) ) (princ (strcat "\nTotal area = " (if (or (= (getvar "lunits") 3) (= (getvar "lunits") 4)) (strcat (rtos area 2) " sq. in. (" (rtos (/ area 144) 2) " sq. ft.)") (rtos area) ) ) ) (ctextc (vl-string-subst "," "." (rtos area))) ;;; (ctextc (rtos area)) (princ) ) The result of the area obtained is available by simply pasting the content (Ctrl+V) on a command line, Word, Excel, etc... The heart of the program is the ctextc function that captures the result and makes it available immediately. Just one thing, in my country we use commas for decimals, so if that's not your problem just put the three commas on the previous line, like this: ;;;(ctextc (vl-string-subst "," "." (rtos area))) (ctextc (rtos area))
    2 points
  2. For creating parcels from polylines for a set area for surveyors this lisp is the bomb! https://www.cadtutor.net/forum/topic/70140-lisp-to-scale-by-moving-only-one-side/page/2/?tab=comments#comment-563855
    1 point
  3. These threads may be helpful: and http://www.cadtutor.net/forum/showthread.php?92673-Offset-only-a-section-of-a-closed-polyline&p=634498#post634498#9
    1 point
  4. For the preview check out the following. This is how to undo multiple commands with one undo. undo with vla looks like these are used in your lisp. you need to move these lines of code to an earlier spot. (Setq thisdrawing (vla-get-activedocument (vlax-get-acad-object))) (vla-startundomark thisdrawing) (vla-endundomark thisdrawing) unfo with command (vl-cmdf "_.Undo" "Be") ;set the beging of undo (vl-cmdf "_.Undo" "E") ;set the end of undo
    1 point
  5. I don't understand the question. You have two structures. Which structure do you want to put on which alignment? You can't put a headwall in the middle of a road. If you're using Civil 3D, you can create a storm drain alignment between the culverts. Add structures and a pipe. This isn't a "trick," it's basic design work. Please provide more information about what you want to do.
    1 point
  6. Can you post a .dwg? Rotate command should work. What exactly is or isn't happening?
    1 point
  7. You're welcome, I am actually unable to add or modify codes in the Lisp but hope some Lisp masters read your post and try to help you.
    1 point
  8. Your using (vla-put-customscale have a look at also (vla-put-twistangle
    1 point
×
×
  • Create New...