pradeep005 Posted January 12, 2016 Posted January 12, 2016 Hi all, I have very basic knowledge in lisp and created very basic lisps. But now i tried one lisp, i.e, Dimensions with specified block in current scale. And also the block insert point should be inserted at mid point of dimension line. Or, after i created number of dimensions, a block would be inserted at all dimensions mid point of dimension lines. i tried my level best but cannot figure out. could anyone help me to get a lisp for the above. so i too can learn how it was done. thanks in advance. Quote
Andrew1979 Posted January 13, 2016 Posted January 13, 2016 I think I understand what he wants - simply add a block in the middle of a dimension line I have no idea how to do that either.....be interested to see what anyone comes up with Quote
pradeep005 Posted January 13, 2016 Author Posted January 13, 2016 Hi Tharwat, Here is what im looking for. Thanks for your help. I tried a little bit, ----------------------- (setvar "dimtad" 2) (command "_dimlinear" pause pause "M" pause pause) ;need pause for user input for dimension text (setq P (getvar "lastpoint")) (command "ddedit" "l" pause "" "") (command "_insert" "block1" "_s" "1" P "0") (setvar "dimtad" 1) (princ) But the dimension text window didnot appear to override the value. Quote
Tharwat Posted January 13, 2016 Posted January 13, 2016 *- Which one is the block , the circle or the rectangle ? *- What is the name of the block? *- Is it aligned or linear dimensions ? Quote
pradeep005 Posted January 13, 2016 Author Posted January 13, 2016 Oh i'm sorry. The ellipse is the block. the name was "bubble" and mostly i using linear dimensions but some times need to use aligned or rotated dimensions too. thank you. Quote
Tharwat Posted January 13, 2016 Posted January 13, 2016 Upload a sample drawing showing clearly your needs of the program if possible. As for aligned dimensions , if the needed block would be inserted between the two extension lines , the block won't be identical to other since linear dimensions could have different length of extension lines. got it? Quote
David Bethel Posted January 13, 2016 Posted January 13, 2016 This should retrieve the information on the 1st TEXT type entity in a DIMENSION. You can then calculate the insert point, scale and rotation angle. [b][color=BLACK]([/color][/b]defun c:dim-ted [b][color=FUCHSIA]([/color][/b]/ ss en ed dn td fe fd tl[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]while [b][color=NAVY]([/color][/b]not en[b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]and [b][color=MAROON]([/color][/b]setq ss [b][color=GREEN]([/color][/b]ssget [b][color=BLUE]([/color][/b]list [b][color=RED]([/color][/b]cons 0 [color=#2f4f4f]"DIMENSION"[/color][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]= [b][color=GREEN]([/color][/b]sslength ss[b][color=GREEN])[/color][/b] 1[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq en [b][color=GREEN]([/color][/b]ssname ss 0[b][color=GREEN])[/color][/b] ed [b][color=GREEN]([/color][/b]entget en[b][color=GREEN])[/color][/b] dn [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 2 ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] td [b][color=GREEN]([/color][/b]tblsearch [color=#2f4f4f]"BLOCK"[/color] dn[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq fe [b][color=MAROON]([/color][/b]cdr [b][color=GREEN]([/color][/b]assoc -2 td[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]while fe [b][color=MAROON]([/color][/b]setq fd [b][color=GREEN]([/color][/b]entget fe[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]if [b][color=GREEN]([/color][/b]member [b][color=BLUE]([/color][/b]cdr [b][color=RED]([/color][/b]assoc 0 fd[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b] '[b][color=BLUE]([/color][/b][color=#2f4f4f]"TEXT"[/color] [color=#2f4f4f]"MTEXT"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]setq tl [b][color=BLUE]([/color][/b]cons fd tl[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq fe [b][color=GREEN]([/color][/b]entnext fe[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]prin1 [b][color=NAVY]([/color][/b]car tl[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] Depending on your DIMSTYLE setup, to say this will be easy would be misleading. HTH -David 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.