Jump to content

Combine the _dimlinear and UCS Commands


johnpieter

Recommended Posts

Any body help..here how to combine this both commands..I want combine this "Ucs" "e" and "_dimlinear"

after command its should ask the select object for UCS position change after that automatic its need to come _dimlinear..without _dimlinear command given..

 

(DEFUN C:test ()

(command "ucs" "e" " " )

(command "_dimlinear" )

(princ)

)

Link to comment
Share on other sites

Check ...

 

(defun c:test (/ ss)
 (if (setq ss (entsel "\n Select One object :"))
   (progn
     (command "_.ucs" "_e" ss )
     (command "_.dimlinear" "" ss pause ))
   (princ)
   )
 (princ)
 )

 

TharwaT

Link to comment
Share on other sites

I’m just wondering, doesn’t the DIMALIGN or DIMLINEAR with Rotated option fit your need?

 

Regards,

Mircea

Link to comment
Share on other sites

thanks for your reply Tharwat...as per this its working good.actually as per this ucs its placing same dim text position.But normally we are doing dimension for one slope line!means as per Ucs selection(Line top means one postion Line bottom means dim text is another position)will come.But as per this code dim text is coming same position.as per ucs selection it should consider..can you help for this

 

(defun c:test (/ ss)

(if (setq ss (entsel "\n Select One object :"))

(progn

(command "_.ucs" "_e" ss )

(command "_.dimlinear" ss pause ))

(princ)

)

(princ)

)Dim.JPG

Link to comment
Share on other sites

What is the benefit of the ucs to be positioned at the selected line ?

 

 

that is for dimention as per that line position(Angle).After the Ucs position (as per the Line) change i want take dimension with dimlinear method.

Link to comment
Share on other sites

When you change your ucs to be at a specific angle of an entity, that would cause the next entity dimension to be rotated accordingly .

 

So things would be mixed up randomly . which would cause the dimension to be far from the selected entity .:?

Link to comment
Share on other sites

This may help you with what you are after . :)

 

(defun c:test (/ ss e p1 p2 ent)
 ; Tharwat 14. 05. 2011
 (if (and (setq ss (entsel "\n Select One Line :"))
          (eq (cdr (assoc 0 (setq e (entget (car ss))))) "LINE")
     )
   (progn
     (if (> (car (setq p1 (cdr (assoc 10 e))))
            (car (setq p2 (cdr (assoc 11 e))))
         )
       (progn
         (setq ent (entmakex
                     (list (cons 0 "LINE") (cons 10 p2) (cons 11 p1))
                   )
         )
         (command "_.matchprop" ss ent "")
         (command "_.ucs" "_e" ent)
         (command "_.dimlinear" "" ss pause)
         (entdel (car ss))
       )
       (progn
         (command "_.ucs" "_e" ss)
         (command "_.dimlinear" "" ss pause)
       )
     )
   )
   (princ "\n Please select line only")
 )
 (princ)
)

 

Tharwat

Link to comment
Share on other sites

Tharwat

More time i want to take dimension for multi line.So only here i have removed that ""{From (command "_.dimlinear" "" ss pause)}.i hope surely you will help for me.Dim2.jpg

Link to comment
Share on other sites

I feel so hard to understand your English and your descriptions as well .

 

The last codes that I posted for you, are doing the trick without taking any consideration about the angle of the selected line , and the dimension text is from left to right and

nothing is upside down as you shown in your last image and which is in the Cyan box.

 

So now , which way you want it to be . the dimension which is in Blue box or the one which is in Cyan box ?

 

Tharwat

Link to comment
Share on other sites

Tharwat

That image cyan colour(2335.1) is i have placed manually(WithOut Code).while we are Changing the Ucs it will ask the Source Object for Position.Suppose we are selecting the top of Line (For Source Object)means dim text will come one direction.Suppose we are selecting the bottom of the line means dim text will come another direction.Please see that Image Cyan box(2335.1).But while we are using the Code Dim text is coming same postion(Selecting the line top or bottom)

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...