AutoCAD .NET :: Search And Work With Attribute Block In Current Space
Dec 4, 2012I want to search and replace value of block reference in layout1. But I do not want to replace that block in layout2 or layout3.
View 2 RepliesI want to search and replace value of block reference in layout1. But I do not want to replace that block in layout2 or layout3.
View 2 Repliesi have a for example a block with one attribute and would like add a new attribute. i´m trying to read the current block and redefine - it comes a new attribute in propertieswindow but not graphical.
(defun c:ent () (setq bn (getstring "
give a block name ")) (setq bez (getstring "
give a attribut name ")) (entmake (list (cons 0 "BLOCK")(list 10 0 0 0)(cons 2 bn)(cons 70 2))) (setq fe (entmakex (list (cons 0 "CIRCLE") (cons 8 "0") (cons 10 '(0 0 0)) (cons 40 1)))) (entmake (list (cons 0 "ATTDEF") (cons 8 "0") (cons 10 '(0 0 0)) (cons 11 '(0 0 0)) (cons 40 1) (cons 1 bez) (cons 3 "TOP") (cons 2 "NAME") (cons 70 0) (cons 73 0) (cons 50 0) (cons 41 1) (cons 51 0) (cons 7 "STANDARD") (cons 71 0) (cons 72 0) (cons 210 (list 0 0 1)) (cons 74 0) (cons 62 256) (cons 39 0) (cons 6 "BYLAYER"))) (entmake (list (cons 0 "ENDBLK")(cons 8 "0"))) (entdel fe) (entmake (list (cons 0 "INSERT")(cons 2 bn)(cons 10 '(0 0 0))(cons 66 1) (cons 62 256) (cons 39 0) (cons 6 "BYLAYER"))) (entmake (list (cons 0
[code]....
select all blocks on certain layers in a drawing, check attribute CIRCUIT in each block if it starts with MS then attribute CONTROL = switched. I hope thats clear enough the way
(defun c:control()
(graphscr)
(Setq sc (ssget "X" '((0 . "INSERT")
[Code].....
I wanna transfer my attribute block values to another attribute text blocks , is there any lisp for that?
Is there a possibility for sum tag values of choice attribute blocks to inside of another attribute text block ?
What I really want to do is on our fire alarm blocks we have 3 different attributes one for the address, the candela and one for misc info. I want to make an attribute that takes the number from the candela (15,30,75or 110) and change a different attribute to a value depending on which candela we use (such as 15=.078, 30=.113, 75=.195 or 110=.259). But I don't want the .078,.113,.195,.259 to print out on paper, I want to export block information excel file so I can add up all values.
View 2 Replies View RelatedI'm working out a LISP for searching my entire drawing for a MLeader with a given value and then do something if it is found.
Currently, my code dies with
; error: Automation Error. Description was not provided.
I do not know what is going wrong & I don't know what must be done next.
(DEFUN ML-SRCHSTR (TXT LBL / SS n_txt_LBL ENT P1 P2) ;|(ML-SRCHSTR TXT)|; (IF (SSGET "x" '((0 . "MULTILEADER"))) (PROGN (SETQ ss (VLA-GET-ACTIVESELECTIONSET (VLA-GET-ACTIVEDOCUMENT (VLAX-GET-ACAD-OBJECT)))) (VLAX-FORent ss(IF (VL-STRING-SEARCH txt (STRCASE (VLA-GET-TEXTSTRING ent))) (PROGN (VLA-CLEAR ss) (INITGET 1 "Yes No") (SETQ n_txt_LBL (STRCAT "
=>> " LBL " Label EXISTS! Add another " txt "? ") y_n (GETKWORD (strcat n_txt_LBL " [Yes/No]: ")) ) (IF(= y_n "Yes") (PROGN (ppa-L-
[Code]...
My MLeader has a _TagBox & it is the attribute of the _TagBox that I am trying to check/compare the "txt" value.
I would like to have an attribute that reads the current date, so every time i plot a sheet its always reading the current date of the attribute.
I have found the following online but the date reads MM/DD/YY
%<AcVar Date f "M/d/yy">%
I need the date to read DD/MM/YY
I'm trying to automate an attribute extraction in the form of a table. I create the .dxe file but when I use this template file with -eattext (or -dataextraction), in a drawing different than the one the .dxe was created in, I still get the original table and not the one with the attribute values of the curent drawing.
View 4 Replies View RelatedIm working on a student version of Architectural CAD 2012 i drew a floor plan and used AEC Dimensions on my model space but when i switch over to work space they don't show up. I tried matching properties and switching between paper and model but so far no luck.
View 2 Replies View RelatedIs it possible, via whatever methods (lisp?) to be able to have a premade block with an attribute and insert it into a drawing then assign a value to it by selecting another existing block in the drawing and using one of its own attribute’s values?
For example, say I have a block representing a telephone and it had an attribute called "PhoneNo" and I inserted it into a drawing showing an office floor plan that had blocks in each office space that are telephone junction boxes with attributes "PhoneExtension". I would like to be able to autocomplete the entering of the “PhoneNo” data by selecting one of the telephone junction boxes in the drawing and using its attribute’s value.
Autocad 2011, Electrical package,
I have an existing title block a few text attributes, to which I wish to add a watermark. I have added it in the block editor as a normal attribute, with the same details as the other attributes that work, only a different tag name. It has a default value, "DRAFT" and is tagged "WMARK". It works fine in the Block Editor, and If I test the block I can edit it to display whatever I want, but if I save the block and open it from Autocad proper, the attribute is not in existence, either as a default value, or editable from block properties, attribute editor or title block editor, whereas all of the other attributes are there. I have used BattMan to verify the settings of the attribute, and the only difference is that the others all have "L" in the "Modes" column, but I think that means that their position is "locked" whereas my new attribute is justified "aligned" therefore cannot be "locked" (This is some assumption on my part, as the documentation on the "Modes" column is almost non-existent). I cannot afford to waste much more time on this issue, as the boss is breathing down my neck, but editing watermarks on every drawing after every revision is frustrating, when it could be an attribute that is editable from the title block editor.
I need to match few attribute values from one block to different block. I download a lisp file called; ca.lsp which can match the single attribute value. I modified it for more than one attribute value matching. It is ok but still wish to overcome two issues for batch prcess
1. picking up the blocks by selection
2. click the alternative block numbers of times to match the numbers of attribute values I needed.
How to modify this lisp I can run it by block name selections instead of picking selection which enable me to run batch process for numbers of drawing? That will be good...
Lisp & Demo file attached (Match attribute value, A, B & C to Attribute 1, 2 & 3).
Is there a way that I can create a block with text ('A') and when I insert the block and populate the block another block block will update also? I am wanting to create a block for x-sec flags, and detail callouts that update their detail titles.
AutoCAD Civil 3D 2012 SP4
Windows 7 (64)
I have 2 drawings with the following content :
Drawing 1 : Contains tree blocks that have a specific scale dependant on the tree size
Drawing 2 : Contains a block with just a point and attribute data about the tree (name, size etc.)
This block is approximatly at the same location as the tree block (0,1 m precision)
Problem I want to join these two items together. In other words, in the tree block that is scaled correctly i want the attribute data with the name, size etc. These blocks don't have a corresponding unique number or something like that.
Is it possible to create a text block attribute in part sketch mode?
View 2 Replies View RelatedI have a small application that zooms on an entity with specific properties. The problem is that if I am in paperspace and the entity is in model space, i cannot see the entity. How can I make the entity's space to become the current space?
View 3 Replies View RelatedI started to develop autocad's application with .Net framework.
But i have some trouble, particularly when i try to find a block by name (not like id).
I would take a block by name, instead to get all block and find one with comparison.
I just started a new job and am struggling to set everything up the way my old company had AutoCad configured. My old company actually had people that were involved in writing the code for AutoCad on the payroll, so hopefully what I'm looking for isn't some intense computer programming issue.
In short, I am trying to be able to create a generic title block in model space, and reference that title block into paper space of a new drawing without having to create a new tab or anything first. A new paper space tab is automatically created upon attaching the new title block. My old company had its own custom menu bar with lots of custom commands, so the work flow would go something like this: "Old company name" in menu bar -> "Insert" -> "Title Blocks" -> "24x36 title block" (or whatever size we wanted to use obv). Once the desired title block size was selected, a new tab would be created in paper space with the title block as an xref, and a copy of the generic title block was saved to the main folder containing drawings of the project, and could be edited with the specific project info from there.
Is there a semi-easy way to do this, or is this a coding issue that a non-programmer such as myself might have some difficulty doing?
I started to develop autocad's application with .Net framework.
But i have some trouble, particularly when i try to find a block by name (not like id).
I would take a block by name, instead to get all block and find one with comparison.
How can resolve this problem?
I've tried doing a block that automatically updates the X and Y coordinates from its moveable leader. I can get it to work in model space or paper space. But my problem is I want it to work in PS, but update with the MS coordinates through the viewport.
I can get it to update, by LISP, by picking a point and passing the points to the blocks attributes. At the moment I have a LISP when actioned it locks the viewports, activates the viewport, and asks you to select a point. Once selected it de-activates the viewport (going back into layout tab) then asks which block you want to update. Where you now select the block and it updates the coordinates. I.e. manually pick the point in MS, switch to PS and then manually pick the block. Then I have to manually modify the leader to the correct location.
I'm hoping that I can (In PS) move the end of the leader to snap to a position in MS and the coord updates to reflect the correct MS coordinates. I'm thinking that maybe this can't be done automatically and that I maybe can move the leader but I'm not sure how I can do it without running a LISP to update the block?
I'd be happy moving the leader then just running a single command and the leader coordinates updating without having to select the points and the block again.
I've attached the block showing the auto update of the attributes (fields).
I'm creating a block with a block attribute.
In the blockeditor I can change the draworder so the attribute is partly under some lines. But the draworder in the blockeditor of the attribute doesn't work in the normal modelspace; the blockattribute is allways on top.
I have been given a set of drawings (300+) and I need to find where and/or if certain blocks (and other objects) are used in these drawings. Is there a utility program or does AutoCAD have the ability to search a group of drawings for a block (by name) and return a list of all the drawings where the block is found.
On that same topic, is there a utility program that will export all the CAD data from a list of drawings to a .csv file or even excel so I can filter and search several drawings for layers, blocks, xrefs etc.
I am trying to insert a block (using .Net) that does not already exist on the drawing. It is on a network share, which is in the search path. If I, from the command line insert the block, it finds it ok and inserts it. But when I do this from .Net code it does not search for the block. So how do you get it to search for the block and insert it?
Here is a code snippet I'm using to insert the block:
Dim myDwg AsDocument = Application.DocumentManager.MdiActiveDocument
Using myDocLock AsDocumentLock= myDwg.LockDocument()
Using myTrans AsTransaction= myDwg.TransactionManager.StartTransaction
'Open the database for WriteDim myBT AsBlockTable = CType(myDwg.Database.BlockTableId.GetObject(OpenMode.ForRead), BlockTable)
[Code]....
how to search for keywords within autocad file? word in title block, I got alot of DWG files inside the Hard drive, my co worker was asking me to plot out one of the drawing, don't know the drawing number but only know the date/mo/years was created, and the words inside the file. i typed in the window explorer as shown below but found none. sometime it's very difficult to look for the certain drawing when someone named by number and letter, i like to name the cad drawing with good description and then i put the dwg # or Pro# in the title block.
View 9 Replies View Relatedto verify if a block exists in the drawing, use the following function, which for is too slow.Is there a faster way to search for a block?
(defun findblock (cerca / blk nomebl trovato) (setq blk (tblnext "BLOCK" 1)) (while blk(progn setq nomebl (cdr (assoc 2 blk)))(if (= nomebl cerca) (setq trovato T) ) ;-(setq blk (tblnext "BLOCK")) ) ) trovato)
When building the first catalog, is there a way to prevent Lightroom from scanning everything connected to the computer?
I want it to scan ONE folder, something without a few hundred thousand TIFF and RAW image files (along with various copies of each of them in full and low res versions of JPG & PNG).
How to make a current date block? I've also looked for the file location block attribute. I know it exists cuz the architect in this office used to have it. When he quit, he took it out of the pc's.
I'm using Architectural Desktop 2.0
I am trying to find a way to programmatically move our AutoCAD room tag attribute data to new AEC space property sets. I work in a hospital that has approx. 1 million s.f. and over 3000 rooms. Obviously a daunting task to do room by room.
View 4 Replies View RelatedWhen the import dialogue box is open in Premiere Pro CC, I sometimes need to use the search box in the upper right-hand corner of the dialogue box. The system will allow me to enter a search term, but it will not do the search. I'm using Windows 8.1 64 bit. Are others experiencing the same problem?
View 4 Replies View RelatedThere are certain occasions where I would like to insert a block to inherit the current layer in an active AutoCAD drawing. This happens frequently when a client requires a certain layering standard and I have a block from another drawing with different layering standards. To correct this it usually involves several steps - Explode and change the layer, setbylayer, bedit, etc,
Is there a command to where I can directly insert a block and its layers change to the current layer of the active AutoCAD drawing?
I need simple code to do just one thing, inserting a dynamic block that is stored in a separate file on my computer (like C:/base/b-22) in the drawing that I'm currently using. For example, I have a windows form with a list box with names of many dynamic blocks that are stored on my c drive, I would like to pick a block with a name and upon a click event of a button or other will go get this block from a separate file and insert it in the drawing I'm currently using, and would need to be able to pick the point of where I want the block to go. I'm using autocad 2010 with visual studio 2008- using the new autocad .net language.
View 9 Replies View Related