Jump to content
RoguePiper

Adding additional text to Dimension Text Override

Recommended Posts

RoguePiper

I have a piping isometric that is not drawn to scale that needs to have the imperial dimensions added. The drawing is currently dimensioned in metric with all dimensions having a text override. I am looking for a way to take the text that is in the override and adding the imperial equivalent ie 300 changed to 300 [11.811]. Is this possible with a Lisp? Will the numbers in the text override be able to be converted?

Share this post


Link to post
Share on other sites
Tharwat

hello ,

 

I also asked a question about Dimensions before, and unfortunetly one body has answerd my question except Mr Kerry Brown,

and the following link belong to his great codes that also he supported me with. So check it out .

 

http://www.theswamp.org/index.php?topic=10317.msg131450#msg131450

 

Regards,

 

Tharwat

Share this post


Link to post
Share on other sites
Lee Mac

Perhaps something like this?

 

(defun c:ImpDim ( / ss )
 ;; © Lee Mac 2010

 (if (setq ss (ssget "_:L" '((0 . "DIMENSION"))))
   (
     (lambda ( i / e s n )
       (while (setq e (ssname ss (setq i (1+ i))))
         (if (and (setq s (cdr (assoc 1 (entget e)))) (setq n (distof s)))
           (entupd
             (cdr
               (assoc -1
                 (entmod
                   (subst (cons 1 (strcat s " [" (rtos n 3) "]")) (assoc 1 (entget e))
                     (entget e)
                   )
                 )
               )
             )
           )
         )
       )
     )
     -1
   )
 )

 (princ)
)

It assumes that the original Dimension Override is purely a number however.

Share this post


Link to post
Share on other sites
RoguePiper

Thanks for info. I will look into both. Lee Mac, I will give yours a try, the original are all numbers.

Share this post


Link to post
Share on other sites
Tharwat
Thanks for info. I will look into both. Lee Mac, I will give yours a try, the original are all numbers.

 

Have you tried it mr Rogue?

 

For me, it is not working although the racism is very clear in that reply !!!!!

Share this post


Link to post
Share on other sites
Lee Mac
Have you tried it mr Rogue?

 

For me, it is not working although the racism is very clear in this reply !!!!!

 

WTH? Racism? Did I miss something? Grow up Tharwat.

Share this post


Link to post
Share on other sites
RoguePiper

Racism? hmmmmm , a little difficult to be racist when I have no idea what race you or anyone else is.

 

Lee Mac posted a specific script, your post was a link to a very informative post that seems more like a tutorial. I have not had a a chance to try it.

Share this post


Link to post
Share on other sites
Lee Mac
can you see the difference between this thread and the following link thread ?

http://www.cadtutor.net/forum/showthread.php?50963-Update-the-contents-of-a-Dimension-Style

 

And there are lots of things to get.....

 

That is not racism, and it clearly reflects how immature you are to suggest such an absurd claim. Do you really expect me to answer every thread on this forum, and hold it against me if I don't?

 

In any case, some of us aren't too tolerant of the code plagiarism you have demonstrated in the past.

Share this post


Link to post
Share on other sites
Tharwat
That is not racism, and it clearly reflects how immature you are to suggest such an absurd claim.

 

Since that you consider your self a mature, your answer should be more polite.

 

Do you really expect me to answer every thread on this forum, and hold it against me if I don't?

 

I do not expect any thing from you since is that is one of your answers.

 

In any case, some of us aren't too tolerant of the code plagiarism you have demonstrated in the past.

 

And I am not waiting for your tolerance at all, beside that, I am very proud of

what I am doing and saying and so on......

 

And if you consider your self is the father of all , its up to you. And of course

me is excluded.

 

your replies claim what you think of ......

Share this post


Link to post
Share on other sites
Lee Mac
Since that you consider your self a mature, your answer should be more polite.

 

I did not consider my response in any way rude - I stated my opinion of your previous response in a clear and concise manner.

 

I do not expect any thing from you since is that is one of your answers.

 

Your previous response suggested that I displayed 'racism' (I think you need to look that word up) towards you since I did not reply to your thread.

 

And I am not waiting for your tolerance at all, beside that, I am very proud of

what I am doing and saying and so on......

 

If that is your view, then we quite clearly disagree on what we consider to be good coding etiquette. But I would prefer if you didn't throw a tantrum should I decide not to answer your future threads.

Share this post


Link to post
Share on other sites
Tharwat

Your previous response suggested that I displayed 'racism' (I think you need to look that word up) towards you since I did not reply to your thread.

 

I have told you before that I do not care if you reply or not. Because you do not give something to be learned by any, you only show your muscles infront

of people. And that's not what I am looking for ....

 

I decide not to answer your future threads.

Please not do reply to my threads at all, since that you will show your prouds againt others, which is completely I hate this kind of habit.

 

When you become more modest, you would be welcomed in that time only.

Share this post


Link to post
Share on other sites
Lee Mac
I have told you before that I do not care if you reply or not.

 

Then why shout 'racism' ?

 

Because you do not give something to be learned by any, you only show your muscles infront

of people When you become more modest, you would be welcomed in that time only.

 

Oh right, I forgot I am only allowed to post code that Tharwat is able to understand. Complexity of code is a matter of opinion: I cannot see how you can reprimand my lack of modesty for posting code just because you feel it is too complex.

Share this post


Link to post
Share on other sites
Lt Dan's legs

to tharwat313,

 

I'm not trying to be mean or a d*ck but I've come here to learn, not to argue

 

www.cadtutor.net homepage

"CADTutor delivers the best free tutorials and articles for AutoCAD, 3ds Max and associated applications along with a friendly AutoCAD forum and an AutoCAD FAQ. If you need to learn AutoCAD, you're in the right place."

 

The way I see it, if you cannot post without getting into an arguement or offend others than maybe this site isn't for you. If you dissagree, just ignore this post.

 

I like to keep stress out of my life as much as possible and you'll be much happier if you do the same.

Share this post


Link to post
Share on other sites
Tharwat
Then why shout 'racism' ?

Because it is the truth. As I told you a long time a go that you do not give a complete help unless someone initiate, And in that time

muscles would be shown clearly.

 

Oh right, I forgot I am only allowed to post code that Tharwat is able to understand. Complexity of code is a matter of opinion: I cannot see how you can reprimand my lack of modesty for posting code just because you feel it is too complex.

 

You still can not get my point well , And that's for sure due to your up rised nose against others. or a toss.

Share this post


Link to post
Share on other sites
Tharwat
to tharwat313' date='[/b']

 

I'm not trying to be mean or a d*ck but I've come here to learn, not to argue

 

www.cadtutor.net homepage

"CADTutor delivers the best free tutorials and articles for AutoCAD, 3ds Max and associated applications along with a friendly AutoCAD forum and an AutoCAD FAQ. If you need to learn AutoCAD, you're in the right place."

 

The way I see it, if you cannot post without getting into an arguement or offend others than maybe this site isn't for you. If you dissagree, just ignore this post.

 

I like to keep stress out of my life as much as possible and you'll be much happier if you do the same.

 

You must be reading what I have inside. So your advise must be given to someone else.

 

I thank you for your kind reply.

Share this post


Link to post
Share on other sites
Lee Mac
Because it is the truth. As I told you a long time a go that you do not give a complete help unless someone initiate, And in that time

muscles would be shown clearly.

 

I answer the threads that I want to answer - I don't know what you are talking about. 'Muscles'? I'm not going to post 'simple' code just so that Tharwat can understand it, believe it or not, there are those who benefit from more challenging code.

 

You still can not get my point well , And that's for sure due to your up rised nose against others. or a toss.

 

Again, I don't know how you draw these conclusions but it is obvious that you are only here to cause trouble. If you don't like the complexity of my code I suggest you ignore it.

Share this post


Link to post
Share on other sites
lpseifert
to tharwat313' date='[/b']

The way I see it, if you cannot post without getting into an arguement or offend others than maybe this site isn't for you.

I think this is getting out of hand...

Really- the combative nature and the allegations of racism. I would suggest that everybody ignore his threads/posts and maybe he'll go away.

Edited by lpseifert

Share this post


Link to post
Share on other sites
RoguePiper

Lee Mac, that is very close to what I was looking for. Thanks you very much. Lets see if we can get this back on track. I just need to tweak it a little bit to make it perfect.

 

Right now it is taking the text as inches and just converting to feet inches, my dimensions are all in mm and need to be converted to decimal inches, to 3 decimal places.

 

And I need to have the imperial dimension appear below the dimension line, so I just need to add a \X into the text string, but not quite sure where that would go.

Share this post


Link to post
Share on other sites
RoguePiper

I changed the code to convert the dimension into inches now. I changed to this

(setq n (/ (distof s) 25.4)))

 

When I try and get the text to display below the dimension line by adding the \X to the string, it drops the \ and only adds the X. Any suggestions?

 

Full modified code

(defun c:ImpDim ( / ss )
 ;; © Lee Mac 2010

 (if (setq ss (ssget "_:L" '((0 . "DIMENSION"))))
   (
     (lambda ( i / e s n )
       (while (setq e (ssname ss (setq i (1+ i))))
         (if (and (setq s (cdr (assoc 1 (entget e)))) (setq n (/ (distof s) 25.4)))
           (entupd
             (cdr
               (assoc -1
                 (entmod
           (subst (cons 1 (strcat s " [" (rtos n 2 3) "]")) (assoc 1 (entget e))
                     (entget e)
                   )
                 )
               )
             )
           )
         )
       )
     )
     -1
   )
 )

 (princ)
)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×