Search the Community
Showing results for tags 'objectdbx'.
-
Using ObjectDBX to copy Layers from one drawing to other
johnbest posted a topic in .NET, ObjectARX & VBA
Hi, I am trying to copy a layer "DATE" from an old drawing file and then pasting to new drawing file. Following is the VBA code... Private Sub CommandButton1_Click() Dim oDoc As New AxDbDocument Dim nDoc As New AxDbDocument Dim newPath As String 'without layer and updated Dim oldPath As String 'to update UserForm1.Hide 'Call the copyLayer() CopyLayers newPath, oldPath End Sub Private Sub UserForm_Activate() oldPath = "E:\ACE\Testing\09Dec\oldFile.dwg" newPath = "E:\ACE\Testing\30Jan\newFile.dwg" savPath = "E:\ACE\Testing\09Dec\oldFile_Copy.dwg" End Sub 'To copy the Layers from newFile and pasting them to OldFile Public Sub CopyLayers(ByVal newFile As String, ByVal oldFile As String) Dim oDbx As Object 'To update i.e OLD FILE Dim nDbx As Object 'Updated i.e NEW FILE Dim olayer As AcadLayer Dim i As Integer With ThisDrawing.Application Set nDbx = .GetInterfaceObject("ObjectDBX.AxDbDocument.18") End With nDbx.Open FileName:=newFile 'Copying the Layers from Updated File i.e NEW FILE Dim copyLay() As Object For Each olayer In nDbx.Layers If UCase(olayer.Name) = "DATE" Then ReDim Preserve copyLay(i) Set copyLay(i) = olayer 'MsgBox olayer.Name i = i + 1 End If Next 'MsgBox i Dim idPairs As Variant 'Dim copyObj As Variant 'Opening the NEW FILE to copy the Layer With ThisDrawing.Application Set oDbx = .GetInterfaceObject("ObjectDBX.AxDbDocument.18") End With oDbx.Open FileName:=oldFile nDbx.CopyObjects copyLay, ThisDrawing.Application.ActiveDocument.ModelSpace, idPairs oDbx.SaveAs savPath Set oDbx = Nothing Set nDbx = Nothing End Sub There no error, but my old file is not getting updated.. !! Whats wrong with this code??? Regards JB -
Generalising on an idea I've had for a while, I offer this program to allow you to import (humourously: 'steal') items from another drawing into the current drawing. Steal Upon running the program the user is prompted for a selection of a drawing to steal from, and, upon selection, a dialog appears detailing items available for import. The user may choose multiple items from a list of... Blocks Layers Linetypes Dimension Styles Text Styles Table Styles MLeader Styles MLine Styles Layouts Page Setups User Coordinate Systems Views Groups Layer States Scales Materials Viewports Drawing Properties Custom Properties ...should these collections contain any items which aren't already present in the current drawing. Dialog Preview A full description of the program and the latest version can be found here. Enjoy! Lee StealV1-8.lsp
-
Hi everyone, is there any ObjectDBX equivalent for getvar and setvar functions? Any reply or clue is fully appreciated.
-
Reading the Insbase of a Block Definition drawing using ObjectDBX
ColinHolloway posted a topic in AutoLISP, Visual LISP & DCL
Hi All Sorry this is a re-post. I couldn't work out how to move a post to the correct area. I need to read the Insbase value of an unopened drawing using ObjectDBX. I have already written code that can extract attributes and re-path xref's so the method of opening the drawing database is known. What I need to know is the property name of the Base or Insbase in Modelspace of a drawing. I have opened the drawing database as variable dbxdoc and using (vlax-dump-object (vla-get-ModelSpace dbxdoc)) I get: ; IAcadModelSpace: A special Block object containing all model space entities ; Property values: ; Application (RO) = Exception occurred ; BlockScaling = 0 ; Comments = "" ; Count (RO) = 96 ; Document (RO) = # ; Explodable = -1 ; Handle (RO) = "2" ; HasExtensionDictionary (RO) = -1 ; IsDynamicBlock (RO) = 0 ; IsLayout (RO) = -1 ; IsXRef (RO) = 0 ; Layout (RO) = # ; Name = "*MODEL_SPACE" ; ObjectID (RO) = 55 ; ObjectID32 (RO) = 55 ; ObjectName (RO) = "AcDbBlockTableRecord" ; Origin = (0.0 0.0 0.0) ; OwnerID (RO) = 56 ; OwnerID32 (RO) = 56 ; Path = AutoCAD.Application: Not applicable ; Units = 0 ; XRefDatabase (RO) = AutoCAD.Application: No database The property Origin is NOT the base for this drawing as the insbase is: Command: insbase Enter new value for INSBASE : The value for insbase must be accessable in the database somewhere but it is eluding me at this time. Thanks in advance for any responses, Colin -
call tblobjname on a drawing opened as ObjecDBX! Is it possible???????
Ahankhah posted a topic in AutoLISP, Visual LISP & DCL
Hi all, the following code shows whether a text style is annotative (written by Lee): (defun LM:isAnnotative (style / object annotx) (and (setq object (tblobjname "STYLE" style)) (setq annotx (cadr (assoc -3 (entget object '("AcadAnnotative"))))) (= 1 (cdr (assoc 1070 (reverse annotx)))) ) ) Is it possible to call tblobjname on a drawing which is opened as a ObjectDBX?- 8 replies
-
- objectdbx
- annotation
-
(and 2 more)
Tagged with:
-
Hi All, who knows whether it is possible to change drawing properties without opening it using ObjectDBX or not? If so how to save the new properties to the drawing file? I greatly appreciate any help.
- 15 replies
-
Spurred into life by this thread, I thought I'd update an old program of mine. I have created this program to enable a user to extract the layer information from multiple drawings in a directory to either Text/CSV file. Example of XML data output using XSL to display data in a CSS styled HTML Table: Enjoy! Lee Code can be found here