Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

x diplacement working y isnt (block insertion)

3 REPLIES 3
Reply
Message 1 of 4
bart_van_tuyl
515 Views, 3 Replies

x diplacement working y isnt (block insertion)

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) "" "" "")
3 REPLIES 3
Message 2 of 4
dbroad
in reply to: bart_van_tuyl

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?

Architect, Registered NC, VA, SC, & GA.
Message 3 of 4
bart_van_tuyl
in reply to: dbroad

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?

Message 4 of 4
dbroad
in reply to: bart_van_tuyl

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

Architect, Registered NC, VA, SC, & GA.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost