Automatically displaying block name?

I am working to help automate some BOM Attribute extraction and other things for a company.Picture inserting blocks representing various versions of windows in a plan view for a building. Ideally, I would like the name of the particular block to automatically display its name as text on the drawing. I realize that I can simply have the text as part of the block when I created it, but would prefer not to type this information twice. (i.e. once when I create the block entities, and then when am prompted for the block name.) There are going to be many variations of this block, and having to put the information in twice in just another place for an error.I think this may be similar to RTEXT in AutoCAD, where things like the filename or date are displayed in a titleblock. However, in this case I want the automatically updated text to be the name of the block itself.Is this doable with the current version? Any ideas?Joe Dunfee

Comments

  • Hi Joe,I'm not completely sure what you're doing, but if it is to create a drawing with blocks and their names (that you could hand off to a draftsman, for example) and you simply want to be certain that you make no mistakes while typing the names, maybe this will help:Bricscad stores the name of the last block placed or created in the variable "insname." If you place a block and you immediately run a lisp routine that places text which it gets from "insname," there will be no opportunity for you to make a typo.Here's an example of such a lisp routine (assuming you have a text style without a fixed height)(defun c:qq()(command "text" "@ 1" "0" (getvar "insbase")))Simply place the block and then type qq. Text will appear at the point you inserted the block, 1 unit high, 0 degrees rotation and the text will be the name of the block. Place the next block and run qq again, and so on. This will only work for the last block placed. (I call this kind of program lisp-on-the-fly - no error checking, no comments, no bells and whistles.)If you are using a text style that has a fixed height, define the function this way:(defun c:qq()(command "text" "@ 0" (getvar "insbase")))You can, of course, otherwise modify the definition to control text justification, pause for insert point, etc.(defun c:qq()(command "text" "j" "mc" pause "0" (getvar "insbase"))) will center the block name at a point you indicate.If you are setting up a library of windows for draftsman, like you described, you realize that by not including the text in the block you're leaving the opportunity open for someone else to make a typo when they're labling the window on the drawing. Don't know what to do about that though. I used to like to have the symbol that would eventually show up on the construction drawing as part of the window block, but that brings up issues of printing scale and symbol rotation and these are things that Bricscad (and Autocad) do not address well.There's probably also a way to do all this with defined attributes, but that also would make you enter the same text at least twice, so probably isn't a path you want to pursue.Hope this is of some value.JohnPS - Just reread your message. If you're setting up a whole automated system for others to use, the above is probably pretty elementary for you. I think you were probably looking for the variable "insname."

  • Thank you for the detailed response. It looks like I will need to go the programming route, using attributes or text in the block.Joe Dunfee

This discussion has been closed.