AutoCAD .NET :: Replace Or Redefine Block Record?
Aug 6, 2012
'How I can replace or redefine block record?'.
I tried the following:
1. Get all the block references
2. Clone it
3. Save to new DateBase
4. Erase old Block REferences and Block Record
5. Copy block references from new DataBase
But it doesn't work.
View 3 Replies
ADVERTISEMENT
Aug 27, 2007
I'm working with some "dirty" blocks that contain several attributes. I've cleaned the blocks up by wblocking, cleaning, & purging the newly created block. I also removed any attributes within the file, including those within blocks within the file. I then renamed the file and inserted it into the drawing, and did a replace block with another through express tools. The problem that I have is the blocks are replaced with the clean version, yet the attributes remain. Is there a solution to this. I do not want any attributes to remain and the only way I know how to fix it is to replace them one at a time.
Also, I'm using AutoCAD 2004.
View 9 Replies
View Related
May 14, 2012
How do I redefine a block...
I want to insert the new block definition in the place of the old one and overwrite it.
The new block has more attributes than the older instance.
What a good method of going about that?
View 8 Replies
View Related
Dec 7, 2011
how I can get VBA to insert/redefine a block reference from another file into a block (of the same name) that already exists in the target drawing?
I've tried using the insertblock method but it produces a 'filer error' - As a bonus point, it'd would also be good to be able to retrieve the contents of the blocks collection in the source drawing in some clever way other than opening it (a bit like browsing using the design centre) ?
ACad, MEP, 3DS Max
Windows 7x64
X5482 @3.2Ghz 8Gb Ram
Quadro FX1700
View 2 Replies
View Related
Apr 16, 2013
I have a drawing with multiple instances of a dynamic block. I have a second drawing with said block modified.
I want the first drawing's block to be updated to the modified block without reinserting each block separately.
I don't have the block as a separate file to "insert", only available to copy. With it being dynamic, I don't trust using the block editor and just copy/paste from the modified into the original.
Is there a way to redefine the block?
View 4 Replies
View Related
Dec 12, 2012
I am trying to edit a description of a block and by following what is in the help it gives me an error. See attached jpeg for error message.
View 5 Replies
View Related
Aug 1, 2013
I'm trying to insert a block, wich contains 2 nested blocks:
1 dynamic block
1 annotive block which has a scale 1:200 with an attribute.
when i'm inserting it trough the toolpalette, and my annoscale is 1:100, the annotive block is converted to the annotive scale 1:100, instead of the 1:200 wich it originally is.
I can't set the annotationscale in the toolpallete, exept when i use macro's. but this also has a drawback.
when i'm inserting the block with a macro, i have to insert a complete drawing wich contains only this one block.This block contains dynamic parameters (i can't add dynamic parameters outside of the blockeditor)
When this block (dwg) is inserted, i explode the block so it becomes the dynamic block again. but the block cannot be redefined, because the actual inserted block is a dwg file.
Is it a drawback of the use of the toolpalette and dynamic / annotive blocks?
View 9 Replies
View Related
Jan 29, 2012
I am using the following function to create a block:
(defun crea-blocco (ip blockname gruppoogg / blkobj sArray c r vla-objects doc) (setq c -1) (repeat (sslength gruppoogg) (setq r (cons (ssname gruppoogg (setq c (1+ c))) r)) ) (setq r (reverse r)) (setq vla-objects (mapcar 'vlax-ename->vla-object r)) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (setq blkobj (vla-add (vla-get-blocks doc) (vlax-3d-point ip) blockname)) (setq sArray (vlax-safearray-fill (vlax-make-safearray vlax-vbObject (cons 0 (1- (length vla-objects)))) vla-objects)) (vla-copyobjects doc sArray blkobj) blkobj)
But if I start this function two times with the same block name, I get a block with the selected objects added to the existing block.
How can I redefine an existing block with vlisp?
View 9 Replies
View Related
Aug 15, 2012
I am trying to redefine Block A to Block B, Block C & Block D based off the value of an Attribute in Block A.
If the Attribute in Block A is "1" then redefine to Block B
If the Attribute in Block A is "2" then redefine to Block C
If the Attribute in Block A is "3" then redefine to Block D
I know it should be able to be done using If and Cond functions within a lisp routine, but I am in a hurry with it and don't have the time to research it anymore.
View 8 Replies
View Related
Jul 7, 2011
I've got a block with multiple attributes. This is not a problem to redefine the blocks attributes.
Some of the attributes contains dynamic fields (blockplace holder x y z parameters) When i insert a block with such atributes that includes the blockplaceholder dynamic fields i get
X: InsertionPoint => It is recognized as an Dynamic field but displays InsertionPoint. and does not update the value.
How can i update the fielddata from vb.net?
Part of the code I use (where i think the problem is)
For Each attid As ObjectId In refbtr attent = tr.GetObject(attid, OpenMode.ForRead) If TypeOf attent Is AttributeDefinition Then Dim attdef As AttributeDefinition = attent Dim attref As New AttributeReference() attref.SetAttributeFromBlock(attdef, myBlockRef.BlockTransform) Dim attrefid As ObjectId = myBlockRef.AttributeCollection.AppendAttribute(attref) tr.AddNewlyCreatedDBObject(attref, True) End IfNext
View 6 Replies
View Related
Dec 4, 2012
I have the following code to redefine a block after a command has ended:
(vl-load-com);*********************************************************(defun Redefine() (command "_.INSERT" "reactortest=reactortest" nil)(princ "Block redefined."));****************************************(vlr-command-reactor nil '((:vlr-commandEnded . endCommand)));******************************************************(defun endCommand (calling-reactor endcommandInfo / thecommandend) ; Get the name of the command.(setq thecommandend (nth 0 endcommandInfo)); Check name of the command.(cond ((= thecommandend "PLINE") (Redefine)));cond(princ));defun(princ)
It doesn't work because INSERT is an interactive function and can't be called while a reactor is active. Is there another way to redefine a block that can be used in a reactor? The block is in one of the default search path's.
View 2 Replies
View Related
Apr 12, 2012
I have blocks with several attribute tags and layers. The problem I am having is somehow when I go to replace the block with a different one the attribute tags stay in the right spot but the symbol acts like it looses its coordinates and comes in a different spot. I cant seem to fix it. When I zoom all it block editor it zooms like I have a symbol way off the mark, but I don't.
View 2 Replies
View Related
Jan 7, 2014
I'm having trouble using the blockreplace' command. Every time I try it tells me the block name has invalid characters. The attached files is an example of the issue. I'm trying to replace the old block with the new block.
View 9 Replies
View Related
Mar 24, 2008
I'm working in ACAD 2008 and have a drawing with multiple blocks (block 'a') that need to be replaced with block 'b'. Is there a command similar to edit/find that I can use to replace the block? I don't want to redefine my block and want to only select certain block 'a' to be replaced, not all block 'a'...
View 9 Replies
View Related
Sep 6, 2012
I remember on a pc i was using once upon a time, AutoCAD had a command called replace block. the shortcut was 'RB' and you could replace a block with another one very easily.
View 2 Replies
View Related
Oct 2, 2013
I am trying to replace the title block of the first sheet of the active drawing via C#. I currently am receiving the following error on the last line of The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)).
Why the code below is throwing this error? I have tried multiple variations of the code below to no avail and I'm sure this is something minor that I am overlooking. The title block definition under Drawing Resources is replaced with no errors, the title block on Sheet 1 is deleted just fine, but I can't seem to add a Title Block back in!
How Documents are defined:
Inventor._DrawingDocument oDoc = getDoc();Inventor.DrawingDocument sourceDoc =(Drawing Document) instance.Documents. OpenWith Options(sPath, options, false); Find, copy, replace: TitleBlockDefinition tBlock = sourceDoc.TitleBlockDefinitions[blockList.SelectedItem.ToString()]; TitleBlockDefinition newBlock = tBlock.CopyTo(oDoc, true); oDoc.Sheets[1].TitleBlock.Delete(); oDoc.Sheets[1].AddTitleBlock(newBlock);
View 1 Replies
View Related
Jul 26, 2012
I am using Express Tools Block Replace how do I keep the blocking being replace from rotating to the orientation of the block using for replacement?
View 2 Replies
View Related
Dec 15, 2011
I'm using an LSP to replace points in a drawing into a block. I've had this working previously, no problems. However, having spent some time creating new blocks when running the LSP the points are being replaced at a different location in the drawing - rendering the whole process useless.
I get the impression this is caused by the block itself rather than the LSP. What am I doing wrong that would cause this effect?
View 1 Replies
View Related
Oct 1, 2013
When using the block editor to rename an existing block to clean that instance of the block name out of the file, the block replace command from express tools does not work.
I select a block enter block editor save block as (new Name) save and exit block editor.Insert new block into the drawing.Express tab on the ribbon select Replace Block select block A to be replaced by Block B purge out instance of block A after complete. It reports 0 blocks replaced
attached is a file with 2 blocks called Drain and Drain X each have the same visibility states I want to replace Drain with Drain X to purge out Drain from my file.
View 9 Replies
View Related
Aug 7, 2012
I have a dynamic block that has a nested temporary block inside it. What I am wanting to do is replace the temporary block with the permanent block. I have tried several different variation of coding but I cannot seem to get this bad boy to work. have used:
(vla-put-name (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))) "tempBlockName") "newBlockName")
this gives me a duplicate names error.
View 1 Replies
View Related
Mar 8, 2012
I am looking for a lisp that can run a block replace on multiple drawings.
Something similar the the express tools block replace I suppose, just able to process many drawings at once.
I'm trying to change attributed approval stamps to attributed inter squad stamps and don't want to have to go through all 150 drawings and do it myself.
View 1 Replies
View Related
Nov 26, 2012
Is there a way to modify this script so you don't have to manually choose the blocks. Instead have it find all block names starting with "Supply Diffuser 24x24" and replace them with a block in the drawing named V01.
(defun C:CHANGEBLOCKS(/ printDebug ssAll ssAllTotal ss ssTotal ssCount ssCount2 ssTotal ssMainBlock ssMainBlock entListMainBlock ssBlocks entListBlock entListBlock2 entElementNewBlock entElementOldBlock entElementOldBlock2 oldBlockName) ;PROGRAM CHANGES MULTIPLE BLOCKS ;WRITTEN BY --- RAUL BENITEZ ;Command reference ;subst - returns a list with a new item substituted for every occurrence of an old item ;quote (or ') - easy way to make the string into a list. ;cdr - returns a list containing all but the first element of
[code].......
View 6 Replies
View Related
Jun 20, 2012
I was able to write a LISP that replaced each node with a block of my choice.However, now I need to find a way now to replace the blocks with different blocks.Each point shares the exact same block called "PILE". Different blocks are on different layers and have 11 different colors. I'd like to replace blocks on layer 1 with a block called "1" and blocks on layer 2 with a block called "2" and so on.I was hoping there would be an easy way to do this in LISP, but I've been unable to get any of my scripts to work.
I've attached a link that visualize what my drawing is currently looking like: [URL] ......
View 2 Replies
View Related
May 7, 2013
I have some code to replace the current title block with a title block from a template file. I just don't like how it adds a new title block definition named "copy of titleblock". I'd like to delete or replace the current title block definition so only the newly added one is listed.
Sub test() Dim odrawdoc As DrawingDocument Set odrawdoc = ThisApplication.ActiveDocument If (odrawdoc.DocumentType <> kDrawingDocumentObject) Then Exit Sub Dim oTemplate As DrawingDocument Dim oSourceTitleBlockDef As TitleBlockDefinition Dim oNewTitleBlockDef As TitleBlockDefinition Dim oSheet As Sheet Set oTemplate = ThisApplication.Documents.Open(ThisApplication.FileOptions.TemplatesPath & "template.idw", False) Set oSourceTitleBlockDef = oTemplate.ActiveSheet.TitleBlock.Definition Set oNewTitleBlockDef = oSourceTitleBlockDef.CopyTo(odrawdoc) ' Iterate through the sheets. For Each oSheet In odrawdoc.Sheets oSheet.Activate oSheet.TitleBlock.Delete Call oSheet.AddTitleBlock(oNewTitleBlockDef) Next oTemplate.CloseEnd Sub
I'm just being picky at this point, but I don't want a buildup of title block definitions. We reuse drawings all the time which is why a simple method of updating a title block would be nice. I can just imagine in some years time after a title block update or two there are 20 "copy of copy of copy of .................. titleblock" listed in a drawing file.
View 8 Replies
View Related
Mar 23, 2012
I need to lay one of our existing blocks ontop of every power outlet on a floorplan (the power outlets are currently shown as a simple shape (eg. either a rectangle, triangle or circle) with text next to it.
There are hundreds of power outlets, so if there is a lisp routine for replacing any part of the power outlet with the block, eg. replacing text/mtext with a block or replacing a pline with a block.
I have found a very successful lisp routine for replacing circles with blocks, but this obviously only works on the power outlets that are shown as circles. So a simpler way of looking at it could be a lisp for drawing a circle around mtext/text then I could simply use the circle to block lisp to place the blocks.
View 5 Replies
View Related
Mar 26, 2012
Does any Lisp routine available to batch replace all the closed polylines with an existing block?
View 9 Replies
View Related
Feb 23, 2012
i have a csv file that has 6 columns, PNEZD and a 6th column which is my notes..i type a star in the data collector after my code, make my note, and then find/replace after i export it and replace star with a column..that gives the desired 6th column in excel that my boss wants....problem is he also wants to see that next to the Full Description in Civil 3d 2012...i tried adding a Point File Format with a 6th Column, User Defined, String for type...named the column Notes...but if i go to edit the point there is no 6th column in the Tool Palette.
View 1 Replies
View Related
Oct 13, 2011
I use the following code to redefine a block:
objBlockTable = (BlockTable)objTransactionManager.GetObject(objDatabaseSource.BlockTableId, OpenMode.ForRead, false);
structObjectId = objBlockTable[strBlockName];
objBlockTableRecord = (BlockTableRecord)objTransactionManager.GetObject(structObjectId, OpenMode.ForRead, false);
objObjectIdCollection.Add(structObjectId);
objIdMapping = new IdMapping();
objDatabaseSource.WblockCloneObjects(objObjectIdCollection, objDatabase.BlockTableId, objIdMapping, DuplicateRecordCloning.Replace, false);
It works for normal blocks but it does not redefine dymanic blocks. Is there a way to redefine dynamic blocks?
View 1 Replies
View Related
Jul 15, 2013
I created a temporary override key in the CUI and assigned a new command to F1. Used to (in other versions of autocad), all was well and it worked great. But for some reason it still invokes the Help command.
When I press the F1 key, my goal is to toggle osnap and ortho at the same time. It does do this, but it also brings up the stupid help menu.
Here is the macro I am using for the override:
^P'_.osmode $M=$(if,$(and,$(getvar,osmode),16384),$(-,$(getvar,osmode),16384),$(+,$(getvar,osmode),16384))
^P'_.orthomode $M=$(if,$(and,$(getvar,orthomode),1),$(-,$(getvar,orthomode),1),$(+,$(getvar,orthomode),1))
View 1 Replies
View Related
Aug 6, 2012
When ever I want to change the sketch plane for a already finished sketch, I use rmb, redefine and choose new plane/ planar face.
Why does the sketch position change from the original coordinate point when redefined to new plane?
Inventor Professional 2013
Vault Collaboration 2013
View 1 Replies
View Related
Sep 13, 2013
I'm trying to set up a company layer structure and want to use LISP. Therefore I'd like to use a template file and set every layer with it's specific linetype and color there. If I change something in the template, say the color of a layer, it should update this in the drawing when I hit the LISP command.
View 9 Replies
View Related