Jump to content

Select Rotated Dimension


mousho

Recommended Posts

hello;

i use this the cide above to select dimension

(ssget "x" (list (cons 0 "Dimension")))

now i need a code to select only Rotated Dimension Only

any Idea???

Link to comment
Share on other sites

Read the comments in the routine for more info.

(if (setq ss (ssget "_X" '((0 . "*DIMENSION"))))
  (repeat (setq in (sslength ss))
    (setq ent (entget (ssname ss (setq in (1- in)))))
    (if (member '(100 . "AcDbRotatedDimension") ent) ;; if this GC is existed among DXF codes then its Rotated Dim.
      (progn
        ;; run your stuff here ....
        )
      )
    )
  )
  • Like 1
Link to comment
Share on other sites

THX

But its not working

maybe u can help me to understand with what i am replacing ss in the command line

(defun c:DIMR ( / ss textString)

(vl-load-com)

	(if (setq ss (ssget "_X" '((0 . "*DIMENSION"))))
		(repeat (setq in (sslength ss))
			(setq ent (entget (ssname ss (setq in (1- in)))))
			(if (member '(100 . "AcDbRotatedDimension") ent) ;; if this GC is existed among DXF codes then its Rotated Dim.
				(progn
					(command
						"-DIMstyle" "A" ss "" ; what i need to write instead ss here
					)
				;; run your stuff here ....
				)
			)
		)
	)

	(princ)
)

 

Edited by mousho
Link to comment
Share on other sites

5 hours ago, mousho said:

THX

But its not working

maybe u can help me to understand with what i am replacing ss in the command line

 

Change:

(setq ent (entget (ssname ss (setq in (1- in)))))

to

(setq ent (entget (setq en (ssname ss (setq in (1- in))))))

Then replace the "ss" variable with "en" in your command string. Let me know if that works - I haven't tested.

Edited by pkenewell
Link to comment
Share on other sites

Maybe just select them like so and make your changes in the property palette ?

(defun c:foo (/ s)
  (cond	((setq s (ssget "_X" '((0 . "*DIMENSION"))))
	 (foreach e (mapcar 'cadr (ssnamex s))
	   (or (member '(100 . "AcDbRotatedDimension") (entget e)) (ssdel e s))
	 )
	 (sssetfirst nil s)
	)
  )
  (princ)
)

 

Link to comment
Share on other sites

Thx to all

lanloylisp (cons 70 0) select "arc length dimmension" i change it to (cons 70 32) and it work

where can i read about cons and what each number represent?

 

tharwat i try the code at home and get error, i try it again at work and see if i get error there to

Link to comment
Share on other sites

33 minutes ago, mousho said:

Thx to all

lanloylisp (cons 70 0) select "arc length dimmension" i change it to (cons 70 32) and it work

where can i read about cons and what each number represent?

 

tharwat i try the code at home and get error, i try it again at work and see if i get error there to

Hi Mousho, have a look on the link below.Hope it helps. https://documentation.help/AutoCAD-DXF/WS1a9193826455f5ff18cb41610ec0a2e719-7a2a.htm#WSc30cd3d5faa8f6d8e3b895ffb7556c21-7ff5

Link to comment
Share on other sites

  • 11 months later...

Hi!

In a drawing with many rows of dims (horizontal, vertical, diagonal...) overlapping each other. Is it possible to select linear Dimensions along a line?

Link to comment
Share on other sites

I asked propably the same in other topic ( 

 ) and nobody gives solution. There is a lisp here

https://translate.google.com/translate?sl=pl&tl=en&u=https://kojacek.wordpress.com/2020/04/16/dim-mo/comment-page-1/?unapproved%3D1001%26moderation-hash%3D6118beff7105091e3f92180303c41b82%23comment-1001

But it moves every dimension on curent X or Y, so if they are even not connected dimensions they are moved. Try to edit IT but i failed.

Maybe it will be good for You.

Also if You need just find overlap there is a Lee mac dimoverlap

 

Edited by zwonko
  • Confused 1
Link to comment
Share on other sites

17 minutes ago, zwonko said:

and nobody gives solution.

 

Use stretch command. drag a box around dims you want to move or "strech" drag them to new location. But mhupp you can't easily select the dims on an angle like the 3rd option.

use this lisp to twist your model space. two points along the dim that you want to be horizontal. once everything is stretched use dvtw again dont pick anything or enter in 0 and it will return to normal.

 

;;----------------------------------------------------------------------;;
;; TWISTS VIEW 
(defun C:DVTW (/ twa sna)
  (setvar 'cmdecho 0)
  (princ "Pick Two Points Along a Desired Hozontal Line or enter angle:")
  (or (setq twa (getangle)) (setq twa 0))
  (setq sna twa
        twa (angtos twa (getvar 'aunits))
        twa (strcat "-" twa)
  )
  (vl-cmdf "_.dview" "" "tw" twa "")
  (setvar 'snapang sna)
  (setvar 'cmdecho 1)
)

 

  • Agree 1
Link to comment
Share on other sites

I'm sorry for making You angry, didn't ment to. It is not like that i think that somebody must give me solutions. I just mean for vuxvix that IT could be hard to make what he wants.

@mhupp You helped me on mamy lisps and i really greatfull for this!

 

stretch is just normal. It is "by hand". If have aby objects on between stretch frame must use layiso to isolate dimlayer only. Also sometimes there are crossing dimensions and once again have to unselect something. Also i have multileaders on same layer. It is just anoying. Of course could be done like that. The worst is not that dims are aligned but that there is always other stuff on stretch frame that must be unselected.

 

There are so many lisp doing just so simple things that could be done in few clicks. But people making lisp to do it faster. 

 

Lisp which I've linked do nearly what "we" need. I've tried to mod it, to let user unselect other dims but i failed. Also I think that it could be somehow restricted to current zoom windows but don't know how.  

Thanks also for the lisp above! It will be helpfull for sure, mainly in other stuff !

Edited by zwonko
Link to comment
Share on other sites

13 hours ago, zwonko said:

I'm sorry for making You angry, didn't ment to.

 

All good wasn't trying to sound mean. This will get you about 80% of what your looking for selecting things. will select all dimensions but the text with leaders isn't (in red)

 

(defun c:test (/ ent)
  (setq p1 (getpoint "\nSelect Point 1:")
        p2 (getpoint "\nSelect Point 2:")
        ang (angle p1 p2) pi/2 (/ pi 2)
        fuzz 0.001
  )
  (setq SS (ssget "_CP" (list (polar p1 (+ ang pi/2) fuzz)
                        (polar p1 (- ang pi/2) fuzz)
                        (polar p2 (- ang pi/2) fuzz)
                        (polar p2 (+ ang pi/2) fuzz))
                        '((0 . "dimension"))
           )
  )
  (sssetfirst nil SS)
  (princ)
)

 

Edited form:https://www.cadtutor.net/forum/topic/17875-how-to-select-objects-that-touch-a-line/?do=findComment&comment=147198

 

Animation.gif.606a525c6f17ad70d7d586955c862b71.gif

Edited by mhupp
fixed code
Link to comment
Share on other sites

Thank You @mhupp! Never thought it could be done just by two clicks instead of selecting dim.

It was even 99%. To get it to work added just a line with stretch and correct (0 . "dimension") . Even that tooks me 1,5hour :P 

(defun c:dimstretch (/ ent p1 p2 fuzz ang)
  (setq p1 (getpoint "\nSelect Point 1:")
        p2 (getpoint "\nSelect Point 2:")
        ang (angle p1 p2) pi/2 (/ pi 2)
        fuzz 0.1
  )
  (setq SS (ssget "_CP" (list (polar p1 (+ ang pi/2) fuzz)
                        (polar p1 (- ang pi/2) fuzz)
                        (polar p2 (- ang pi/2) fuzz)
                        (polar p2 (+ ang pi/2) fuzz))
                      '((0 . "dimension"))
           )
  )

(command "stretch" ss "" p1 pause)
  (princ)
)

 

But there is some problem with some dims. Look on the attached DWG (dims marked RED). Don't know why exacly... It looks like problem is with the dims below something.

Tried to make it another way, using thing like

(command "isolateobjects" ss1 "") ; isolating all dims


(setq poin1 (polar p1 (- ang pi/2) fuzz))
(setq poin2 (polar p2 (+ ang pi/2) fuzz))
(command "stretch" poin2 poin1 "" p1 pause) ; made stretch working on crossing polygon instead off objects

But still something is not working properly. No must get back to work, but later maybe i will try to changed it.

dimstretch.dwg

Edited by zwonko
Link to comment
Share on other sites

36 minutes ago, zwonko said:

But there is some problem with dims below something. Look on the attached DWG (dims marked RED). Don't know why.

 

Noticed if you snap to the text of the dimension it would only move the text. is this the problem you are talking about?  was able to move the red dims with out problem.

set osnap to only midpoint so you can quickly pick the midpoint of the dim line and avoid picking the dim text

updated the stretch command to use p2 instead so you don't have to mouse over back to p1

 

(defun c:dimstretch (/ ent p1 p2 fuzz ang)
  (setq oldsnap (getvar 'osmode))
  (setvar 'osmode 2)
  (setq p1 (getpoint "\nSelect Point 1:")
        p2 (getpoint "\nSelect Point 2:")
        ang (angle p1 p2) pi/2 (/ pi 2)
        fuzz 0.1
  )
  (setq SS (ssget "_CP" (list (polar p1 (+ ang pi/2) fuzz)
                        (polar p1 (- ang pi/2) fuzz)
                        (polar p2 (- ang pi/2) fuzz)
                        (polar p2 (+ ang pi/2) fuzz))
                        '((0 . "dimension"))
           )
  )
  (command "stretch" ss "" p2 pause)
  (setvar 'osmode oldsnap)
  (princ)
)

 

Link to comment
Share on other sites

6 hours ago, mhupp said:

Noticed if you snap to the text of the dimension it would only move the text. is this the problem you are talking about? 

No, it is not that.

Looks like it is ZWCAD problem. On AUTOCAD works perfecly. Some of the red dims move with the attachment points so stretch result can be like here.

image.thumb.png.d2db50eddbaf1062ebd535a995be6cc5.png\

 

Nut... tried to change fuzz and it works. If fuzz is example 0.1 or 0.01 or 1 is not working properly. For fuzz 2, 5, 7, 20 not working at all (nothing is stretched). For fuzz 10,50,100 works perfectly o_O

Link to comment
Share on other sites

Chào! @zwonko @mhupp

 

I have read your topic. I also tried using the DIM-MO lisp. After the "Dimension selection" prompt, nothing happens.
-The lisp in the replies I have also tried (everything seems to be around the stretch command). It is similar to the way I am using below:
Use the command Stretch + macro selection Dims ( horizal or vertical )
However, my Horizal macro sometimes works incorrectly. Can you check it out!? Thanks
-Based on Lisp Dimstrech: Is it possible to add an operation to deselection Dimensions horizontally or vertically (optional)!?

Sel Hor_Ver Dimensions.txt

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...