solidworks2014 Posted April 23, 2014 Share Posted April 23, 2014 Go to the block took the name lisp Quote Link to comment Share on other sites More sharing options...
Bhull1985 Posted April 23, 2014 Share Posted April 23, 2014 What is this and why would you post such a sentence Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 23, 2014 Share Posted April 23, 2014 Well we can't accuse the OP of being too verbose. Maybe he is looking for something like SELECTSIMILAR but for blocks. You know...select blocks by name. I think I may have encountered such a lisp routine in my travels. I'll have a look. I'm thinking it may have been by Tharwat. Possibly back in 2012? Quote Link to comment Share on other sites More sharing options...
samifox Posted April 23, 2014 Share Posted April 23, 2014 What is this and why would you post such a sentence and such a name? Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 23, 2014 Share Posted April 23, 2014 I found the lisp routine but it works differently than I had remembered. The user has to edit the lisp routine for the name of the block they want to find rather than clicking on a block in the drawing. Oh well. I got it. Use QSELECT to find all the instances of a particular block in a drawing. No need for a lisp routine. The sequence is as follows... Display the Properties palette (Ctrl+1). Click the Quick Select button at the upper-right corner of the Properties palette. In the Quick Select dialog box, from the Object Type drop-down list, choose Block Reference. If you choose one of the blocks before you start, the Object Type will already be set to Block Reference From the Properties pane, choose Name. From the Value drop-down list, choose the name of the block that you want to count. Click OK to close the Quick Select dialog box. Source: Ellen Finkelstein's website. Quote Link to comment Share on other sites More sharing options...
Bhull1985 Posted April 23, 2014 Share Posted April 23, 2014 Respectfully, are you assuming OP's intentions or were you able to somehow decipher his 8 word description of a need? Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 23, 2014 Share Posted April 23, 2014 Are you talking to me? Quote Link to comment Share on other sites More sharing options...
Bhull1985 Posted April 23, 2014 Share Posted April 23, 2014 Yes, because you seem to have an idea of what the OP needs Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 23, 2014 Share Posted April 23, 2014 It was only a guess. The OP's other requests are just as cryptic. Quote Link to comment Share on other sites More sharing options...
solidworks2014 Posted April 23, 2014 Author Share Posted April 23, 2014 Write a lisp block name Quote Link to comment Share on other sites More sharing options...
solidworks2014 Posted April 23, 2014 Author Share Posted April 23, 2014 Write a lisp block name [/url[/img] Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 24, 2014 Share Posted April 24, 2014 This will tell you the name (princ "\nPick a block) (setq bname (cdr (Assoc 2 (entget (car (entsel)))))) (alert (strcat "Block name is " bname)) Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 24, 2014 Share Posted April 24, 2014 It might help in the future if you (solidworks2014) were a bit more descriptive with your questions. Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted April 24, 2014 Share Posted April 24, 2014 try this. (defun c:blknm() (setq blknm (cdr (Assoc 2 (entget (car (entsel)))))) (setq ptxt (getpoint"\nPoint")) (COMMAND "TEXT" ptxt 5 0 blknm ) ) Quote Link to comment Share on other sites More sharing options...
MSasu Posted April 24, 2014 Share Posted April 24, 2014 That code will fail for entities that doesn't use DXF code 2 (i.e. a line), so may be interesting to filter for blocks only: (if (and (setq ssetBlock (ssget "_:S:E" '((0 . "INSERT")))) (setq nameBlock (cdr (assoc 2 (entget (ssname ssetBlock 0))))) (setq pointPick (getpoint "\nInsertion point: "))) (command "_TEXT" "_J" "_MC" "_non" pointPick (getvar "TEXTSIZE") 0.0 nameBlock) ) Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted April 24, 2014 Share Posted April 24, 2014 That code will fail for entities that doesn't use DXF code 2 (i.e. a line), so may be interesting to filter for blocks only: (if (and (setq ssetBlock (ssget "_:S:E" '((0 . "INSERT")))) (setq nameBlock (cdr (assoc 2 (entget (ssname ssetBlock 0))))) (setq pointPick (getpoint "\nInsertion point: "))) (command "_TEXT" "_J" "_MC" "_non" pointPick (getvar "TEXTSIZE") 0.0 nameBlock) ) Thanks MSasu for this clarify you are right for this . Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted April 24, 2014 Share Posted April 24, 2014 That code will fail for entities that doesn't use DXF code 2 (i.e. a line), so may be interesting to filter for blocks only: MSasu Why all of them fail with dynamic block,if it possible to work with DB please clarify the reasons . thanks. Quote Link to comment Share on other sites More sharing options...
MSasu Posted April 24, 2014 Share Posted April 24, 2014 For dynamic blocks, please chck this article of Lee Mac. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 25, 2014 Share Posted April 25, 2014 Seeing how we are all guessing (solidworks2014 where are you), guys why not just pull block insertion pt out also do a quick polar and write blockname removing need for pick point. Quote Link to comment Share on other sites More sharing options...
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.