resullins Posted March 3, 2021 Posted March 3, 2021 Hey guys, I'm gonna revive this thread... I tried the method above as I have the same request. However, when I go to the Chain Action option, it gives me an Error "Item was Deleted." Not sure what's happening. Then if I go to test the block, none of my new parameter sets show up. Anything? Quote
steven-g Posted March 4, 2021 Posted March 4, 2021 Can you post the block, we might be able to see what the problem is. Quote
resullins Posted March 5, 2021 Posted March 5, 2021 I ended up starting from scratch with new geometry, and got it to work. Unfortunately, because my geometry and my letter have different base points, it's a little weird, and I'm going to have to play with it... but I understand the premise now! Quote
ammobake Posted March 5, 2021 Posted March 5, 2021 (edited) Since the North arrow would be case sensitive based on the sheet configuration, viewport placement, etc... (in paper space) there are other options. A viewport within a viewport would work fine. One with the N text (perhaps a circle) within a larger circle containing the north arrow. It would stay in model space - so if you rotate the viewport the North arrow will always be accurate and the N text always true. The good thing about having circle viewports is they're easy to rotate around the center point without affecting anything.. If you have another rotated viewport, you could easily match the angle by using a reference line or using matchprop command. There would be some additional steps, but it would work. Although, an ideal method would be to have a LISP where you could click the viewport and it would insert the north arrow at a matching angle. -ChriS Edited March 5, 2021 by ammobake Quote
BIGAL Posted March 6, 2021 Posted March 6, 2021 I think this is the final version does what you want. ; Rotate a block in pspace to match world in model ; By Alan H Aug 2020 (defun c:roblklay ( / pt obj1 obj rot ent ang oldang mpt1 mpt2 oldangdir oldsnap oldaunits MAXPOINT MINPOINT OBJ2 POINTMAX POINTMIN PT1 PT2 PT3 PT4 SSS X) (vl-load-com) (command "._PSPACE") (setq oldang (getvar 'aunits)) (setvar 'aunits 3) (setq oldangdir (getvar 'angdir)) (setvar 'angdir 0) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 512) (princ "\n") (setq pt (getpoint "\nSelect a viewport")) (setvar 'osmode 0) (setq pt1 (mapcar '+ pt (list 1.4 1.4 0.0))) (setq pt2 (mapcar '+ pt1 (list -2.0 0.0 0.0))) (setq pt3 (mapcar '+ pt2 (list 0.0 -2.0 0.0))) (setq pt4 (mapcar '+ pt2 (list 2.0 0.0 0.0))) (setq sss (ssget "F" (list pt1 pt2 pt3 pt4))) (repeat (setq x (sslength sss)) (if (= (cdr (assoc 0 (entget (ssname sss (setq x (- x 1)))))) "VIEWPORT") (setq obj1 (vlax-ename->vla-object (ssname sss x))) ) ) (setq ang (vlax-get obj1 'TwistAngle)) (setq ent (entsel "\nPick block ")) (command "ucs" "ob" ent) (setq obj (vlax-ename->vla-object (car ent))) (vla-GetBoundingBox obj 'minpoint 'maxpoint) (setq pointmin (vlax-safearray->list minpoint)) (setq pointmax (vlax-safearray->list maxpoint)) (command "ucs" "w") (setq mpt1 (mapcar '/ (mapcar '+ (trans pointmin 1 2) (trans pointmax 1 2)) (list 2.0 2.0 2.0) )) (vla-put-rotation obj 0.0) (setq obj2 (vlax-ename->vla-object (car ent))) (vla-GetBoundingBox obj2 'minpoint 'maxpoint) (setq pointmin (vlax-safearray->list minpoint)) (setq pointmax (vlax-safearray->list maxpoint)) (setq mpt2 (mapcar '/ (mapcar '+ pointmin pointmax ) (List 2.0 2.0 2.0))) (command "move" ent "" mpt2 mpt1) (command "rotate" ent "" mpt1 ang) (setvar 'aunits oldang) (setvar 'angdir oldangdir) (setvar 'osmode oldsnap) (princ) ) Quote
ammobake Posted March 8, 2021 Posted March 8, 2021 Cool that works. If you want the North arrow to stay static you can apply the ROBLKLAY lisp to just the arrow portion and have the N text stay at zero rotation. I'm curious if this can be done in one block but I don't think it can. it might be possible to apply constraints to keep the rotation of the N text at zero but any rotation applied to the parent would rotate everything - even with the constraints applied. -ChriS Quote
BIGAL Posted March 10, 2021 Posted March 10, 2021 I would have thought the N is always orientated in the direction of the arrow, in a dynamic block maybe rotate 180 so its not up side down. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.