Akanezuko Posted September 4 Posted September 4 I have a lisp which insert mleader with block and the block has attribute. while i use that lisp code it inserted the block but the attribute font and text size has been changed. How to change its attribute font and text size. Please anyone help!!! Quote
Akanezuko Posted September 5 Author Posted September 5 Sure, here is the DWG and lisp file. In DWG files there are two blocks with line. I want to automate it with mleader. test.lsp.lsp Test_file.dwg Quote
Emmanuel Delay Posted September 6 Posted September 6 The block is inserted as it's made. I'm not sure if I understand the problem. Anyway, I edited your block, I name the block "ROADWORDAHEAD" (I'm oldfashionned, I think blocknames better not have space characters) I changed the attribute size in the block edit. I also switched the caption of point 1 and point 2. (feel free to put them back) Command: BP See if this code works with the file I uploaded (defun c:bp ( / block_name pt1 pt2 num dim ent obj) (setq cmd (getvar "cmdecho")) (setvar "cmdecho" 0) (setq atd (getvar "attdia")) (setvar "attdia" 0) (setq block_name "ROADWORDAHEAD") (setq pt1 (getpoint "\nSelect block insertion point: ")) (setq pt2 (getpoint pt1 "\nSelect object insertion point: ")) (setq num "W20-1") (setq dim " ") (command "mleader" "o" "c" "b" block_name "x" pt2 pt1) ;; num dim (setq ent (entlast)) (setq obj (vlax-ename->vla-object ent)) (vla-put-ArrowheadSize obj 0) (vla-put-ScaleFactor obj 6.86) (setvar "attdia" atd) (setvar "cmdecho" cmd) (princ "\nComplete!") (princ) ) Test_file.dwg Quote
BIGAL Posted September 6 Posted September 6 A comment, do you know how to make a pop menu or a tool palette ? This is a very easy way of choosing your block to use. You can have multiple groups of blocks so choose from one catergory a sign of the one type. Same with your speed tables which at moment in this dwg are A$C261F4F67 rather than proper block name. There is ways of short cutting the making of a mnu. Quote
Akanezuko Posted September 9 Author Posted September 9 On 9/6/2024 at 12:02 PM, Emmanuel Delay said: The block is inserted as it's made. I'm not sure if I understand the problem. Anyway, I edited your block, I name the block "ROADWORDAHEAD" (I'm oldfashionned, I think blocknames better not have space characters) I changed the attribute size in the block edit. I also switched the caption of point 1 and point 2. (feel free to put them back) Command: BP See if this code works with the file I uploaded (defun c:bp ( / block_name pt1 pt2 num dim ent obj) (setq cmd (getvar "cmdecho")) (setvar "cmdecho" 0) (setq atd (getvar "attdia")) (setvar "attdia" 0) (setq block_name "ROADWORDAHEAD") (setq pt1 (getpoint "\nSelect block insertion point: ")) (setq pt2 (getpoint pt1 "\nSelect object insertion point: ")) (setq num "W20-1") (setq dim " ") (command "mleader" "o" "c" "b" block_name "x" pt2 pt1) ;; num dim (setq ent (entlast)) (setq obj (vlax-ename->vla-object ent)) (vla-put-ArrowheadSize obj 0) (vla-put-ScaleFactor obj 6.86) (setvar "attdia" atd) (setvar "cmdecho" cmd) (princ "\nComplete!") (princ) ) Thanks for replying. Actually I need to do it program not in DWG file Test_file.dwg 3.9 MB · 2 downloads Quote
Akanezuko Posted September 9 Author Posted September 9 On 9/7/2024 at 4:43 AM, BIGAL said: A comment, do you know how to make a pop menu or a tool palette ? This is a very easy way of choosing your block to use. You can have multiple groups of blocks so choose from one catergory a sign of the one type. Same with your speed tables which at moment in this dwg are A$C261F4F67 rather than proper block name. There is ways of short cutting the making of a mnu. No I don't know how to make this. I am new in this field. Quote
BIGAL Posted September 9 Posted September 9 (edited) Ok making a mnu file is easy using notepad, you load a mnu file using the Menuload command. A menu can have pop menu's, toolbars, images and digitiser. All in on menu. This method is very old so the images are Slides just do MSLIDE it will capture your current cad image Vslide lets you have a look at it. You can use a lisp to make the slides I have made like a 100 in one go. Were I used to work we tended to have all the blocks as separate dwg's but saved in a common directory and only had the blocks that we really needed in the dwt. The pop menu in the image has like 130 lisps behind it. Ok how to start, the simplest is make a pop menu for say your DWT that matches all the blocks inside it. Like your sample dwg. Fix the blocks by using rename for the blocks that are named A$C261F4F67 etc. Send me a PM with say this dwt attached and will get you started. You can add more blocks even in other dwg's. Edited September 9 by BIGAL 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.