Array Object Not parallel to the line What error ?

Array Object Not parallel to the line What error ?

jaimuthu
Advocate Advocate
280 Views
3 Replies
Message 1 of 4

Array Object Not parallel to the line What error ?

jaimuthu
Advocate
Advocate

(defun c:PT (/ o l pt va di an et xval noc obj1 e)
  
  (setq
    pt (getpoint "\nPick the first point:") 
    xv(car pt) yv(cadr pt)
  
    va (getpoint pt "\nPick the second point:") 
    et (getdist "\nEnter Thickness:") 
    an (angtos(angle pt va)2 3) 
    xval (getdist "\nEnter Length (X value):") 
    sd(getint "\n Enetr Spacer :")
    dbc(+ xval sd)
     xy(list xv (+(- yv 80)et))

    p3(polar pt (/ pi 2) 10)

    

    ) 

 
  (if (zerop xval)
    (progn
      (princ "\nError: Length (X value) cannot be zero.")
      (exit)
    )
  )

   

  
  (setq di (distance pt va))

  
  (setq noc (fix (+ 1(/ di xval)))) 

  
  (if (< noc 1)
    (setq noc 1)
  )

 
  (command "ZOOM" "S" pt va)

  


  (command "_.Insert" "D:/IDS/OTHERS/PAT.DWG" pt "" "" an)
  (setq obj1 (entlast))

  
  (setq o (vlax-ename->vla-object obj1))

 
  (setq l (list (cons "X" xval) (cons "Y" et)))  

  
  (foreach prop (vlax-safearray->list (vlax-variant-value (vla-getDynamicBlockProperties o)))
    (if (setq e (assoc (vla-get-PropertyName prop) l))
      (vla-put-value prop (vlax-make-variant (cdr e) 5))
    )
  )

 
  (command "copy" obj1 "" pt "ar" noc (polar pt (angle pt va) dbc) "")

  
  (command "ZOOM" "P")


  (princ an)
)
0 Likes
Accepted solutions (1)
281 Views
3 Replies
Replies (3)
Message 2 of 4

Moshe-A
Mentor
Mentor

@jaimuthu ,

 

why did you open a new thread? 

 

i see you have a working lisp?

what do you mean by not parallel? 

you want the blocks to be aligned exactly on the line you select?

 

 

0 Likes
Message 3 of 4

komondormrex
Mentor
Mentor
Accepted solution

add 

(command "move" obj1 "" "_non" (vlax-get o 'insertionpoint) "_non" pt)

before 

(command "copy" obj1 "" pt "ar" noc (polar pt (angle pt va) dbc) "")

0 Likes
Message 4 of 4

jaimuthu
Advocate
Advocate

thanks komondormrex its work good

0 Likes