Hi I have the following routine which works well for displacing items in an x-direction but i cant get it to function in the Y-direction which has got me totaly baffeld???
(defun C:HHVANDAMWRC18X185R (/ MYPOINT) (setq Dbx (open_dbx "C:/ICT/AutoCAD_Architecture_suite_2012/Blocks/VAN DAM BUUNNIK/GOOTLIJSTEN (20140321-A).dwg")) (vla-CopyObjects Dbx (vlax-safearray-fill (vlax-make-safearray vlax-vbObject '(0 . 0)) (list (vla-item (vla-get-blocks dbx) "HHVANDAM-WRC-18x185R")) ) (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)) ) ) (princ "\nLETOP!: Druk Esc toets om deze functie te verlaten...") (setq MYDIST (cond ((getint "\nGeef een Y-**** invoeg waarde aan (millimeters) <40>: ")) (t 40))) ;(setq MYDISTNEGATIVE (- MYDIST (* 2 MYDIST))) (while (setq MYPOINT (getpoint "\nSelecteer invoegpunt: "))
however if i change the line to the following it all goes pear shaped?
(command "_.insert" "HHVANDAM-WRC-18x185R" (polar MYPOINT MYDIST 0) "" "" "")
Sorry,
I must be missing something. I see neither an x nor a y-displacement. What is posted is a fragment that copies a block definition from an external drawing to the active document and then asks for an integer distance defaulting to 40. It then begins a while loop with a getpoint prompt. You also quoted out a statement that could have been better written, (setq mydistnegative (- mydist))
Did you post the correct fragment?
Yess what I meant was that I wanted to know if the integer distance defaulting, which displaces in the x-axis be changed so that it displaces in the y-axis instead?
If the question is about the polar function then to offset in the y distance direction, you would need
(polar mypoint (/ pi 2.0) mydist)
The format for the polar function is (polar <point> <angle in radians> <distance>)
toht zeens