Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/24/2020 in all areas

  1. Hi Elias, You need to change some lines below, hope your issue is resolved. 'Replace line If Sheet1.CheckBox2.Value = True Then tex = "P. " & rn - 1 & Chr(10) & tex If Sheet1.CheckBox6.Value = True Then tex = rn - 1 & Chr(10) & tex 'with If Sheet1.CheckBox2.Value = True Then tex = "P. " & rn - 2 & Chr(10) & tex If Sheet1.CheckBox6.Value = True Then tex = rn - 2 & Chr(10) & tex 'Replace line p2(0) = P1(0) + Sheet1.TextBox2.Text: p2(1) = P1(1) + Sheet1.TextBox3.Text: p2(2) = 0: Cells(rn, 2) = rn - 1: Cells(rn, 3) = P1(0): Cells(rn, 4) = P1(1): Cells(rn, 5) = P1(2): Cells(rn, 6) = jeenee 'with p2(0) = P1(0) + Sheet1.TextBox2.Text: p2(1) = P1(1) + Sheet1.TextBox3.Text: p2(2) = 0: Cells(rn, 2) = rn - 2: Cells(rn, 3) = P1(0): Cells(rn, 4) = P1(1): Cells(rn, 5) = P1(2): Cells(rn, 6) = jeenee Bye
    1 point
  2. You could check for intersections between the dimensions, however this method will only use the boundingbox of the dimensions and so will not be 100% accurate. To demonstrate my point, try this code on two overlapping dimensions: (defun c:test ( / e1 e2 ) (vl-load-com) (if (and (setq e1 (LM:SelectifFoo (lambda ( x ) (eq "DIMENSION" (cdr (assoc 0 (entget x)))) ) "\nSelect First Dimension: " ) ) (setq e2 (LM:SelectifFoo (lambda ( x ) (eq "DIMENSION" (cdr (assoc 0 (entget x)))) ) "\nSelect Second Dimension: " ) ) ) (foreach x (LM:GroupbyNum (vlax-invoke (vlax-ename->vla-object e1) 'IntersectWith (vlax-ename->vla-object e2) AcExtendNone ) 3 ) (command "_.point" "_non" x) ) ) (princ) ) ;;-------------------=={ Select if Foo }==--------------------;; ;; ;; ;; Continuous selection prompts until the predicate function ;; ;; foo is validated ;; ;;------------------------------------------------------------;; ;; Author: Lee McDonnell, 2010 ;; ;; ;; ;; Copyright © 2010 by Lee McDonnell, All Rights Reserved. ;; ;; Contact: Lee Mac @ TheSwamp.org, CADTutor.net ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; foo - predicate function taking ename argument ;; ;; str - prompt string ;; ;;------------------------------------------------------------;; ;; Returns: selected entity ename if successful, else nil ;; ;;------------------------------------------------------------;; (defun LM:SelectifFoo ( foo str / e ) ;; © Lee Mac 2010 (while (progn (setq e (car (entsel str))) (cond ( (eq 'ENAME (type e)) (if (not (foo e)) (princ "\n** Invalid Object Selected **")) ) ) ) ) e ) ;;-----------------=={ Group by Number }==--------------------;; ;; ;; ;; Groups a list into a list of lists, each of length 'n' ;; ;;------------------------------------------------------------;; ;; Author: Lee McDonnell, 2010 ;; ;; ;; ;; Copyright © 2010 by Lee McDonnell, All Rights Reserved. ;; ;; Contact: Lee Mac @ TheSwamp.org, CADTutor.net ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; l - List to process ;; ;; n - Number of elements by which to group ;; ;;------------------------------------------------------------;; ;; Returns: List of lists, each of length 'n' ;; ;;------------------------------------------------------------;; (defun LM:GroupByNum ( l n / a b ) ;; © Lee Mac 2010 (while l ( (lambda ( i ) (while (< 0 i) (setq a (cons (car l) a) l (cdr l) i (1- i)) ) (setq b (cons (reverse a) b) a nil) ) n ) ) (reverse b) )
    1 point
×
×
  • Create New...