Is there any chance to insert a Strechable Dynamic block to a drawing by the user clicking 2 points?
1. Insertion point ( Base point of the block)
2. End of stretch point (Strech the dynamic part with reference user click 2, the rotation should align with the stretch direction.)
DWG is attached with reference to Block and its application
Thank you
Solved! Go to Solution.
Solved by komondormrex. Go to Solution.
it seems you've got mirrored blocks in a dwg sample. check the lisp below that inserts dyn block and stretches it to the distance between two points selected.
(defun C:insert_d_block (/ insertion_point dyn_width_point insert_name insert_layer vcd_block target_property)
(setq insertion_point (trans (getpoint "\nPick block's insertion point: ") 1 0)
dyn_width_point (trans (getpoint insertion_point "\nPick block's dyn width point: ") 1 0)
insert_name "-ep-vcd"
insert_layer "m-vcds"
vcd_block (vla-insertblock (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
(vlax-3d-point dyn_width_point)
insert_name
1 1 1 (angle insertion_point dyn_width_point)
)
vcd_block_dynamic_properties (vlax-invoke vcd_block 'getdynamicblockproperties)
)
(vla-put-layer vcd_block insert_layer)
(if (vl-some '(lambda (property) (= "Distance1" (vla-get-propertyname (setq target_property property)))) vcd_block_dynamic_properties)
(vla-put-value target_property (distance insertion_point dyn_width_point))
)
(princ)
)
I had a problem with the block. when I fixed it. it's showing this way.
any chance to insert default as the correct method?
It will save a TON of time.
Thank you Very much.
Can't find what you're looking for? Ask the community or share your knowledge.