Quantcast
Channel: Autodesk India Community aggregator
Viewing all 1680 articles
Browse latest View live

AutoCAD Customization: .NET: Moving a Circle Z direction along the Current UCS

$
0
0

I have a circle that I would like to move ‘Z’ direction along the Current UCS. The Current UCS can be in any 3d plane.

 

The code that I have only moves the circle 5 units up along the WCS.

 

                Dim Zp As New Vector3d(0, 0, 5)
                Zp.TransformBy(ed.CurrentUserCoordinateSystem)
                myCircle.TransformBy(Matrix3d.Displacement(Zp))

 

Please help. Thank you.

 

-J

 

 

 


AutoCAD Customization: .NET: Bug in edge enumerator

$
0
0

Hi

 

There seems to be some issues with the Brep edge enumerator.  Firstly, after 4 edges it is not returning Current to null.

 

But more importantly, the last edge of the loop appears to have vertex1 and vertex2 flipped - so the last edge is pointing in the opposite direction.  Is this a know issue?  Does it happen with every edge?

 

Thanks

AutoCAD Customization: Visual Basic Customization: Extracting attributes into a text file with a script

$
0
0

hello,

 

I have a requirement to extract metadata from AutoCAD files with a script. This metadata is the attributes that appear in the files Title Block in the corner. I have come up with some code that I believe can do this, but I cannot run it, since I've been developing in Visual Studio using .NET, and it appears that that .NET API can only be used to build plugins for AutoCAD.

 

Do I have to use VBA to access the COM? How do I even get started with VBA/COM API? It took me forever to actually find a listing for the .NET Object Model - I don't want to search for that long again to find the COM API, especially if I'm going about this in the wrong way again.

 

Thanks,

-George

 

Here is the code I've written to extract the Attributes, but it's probably very wrong as well, since I have not had the opportunity to test it:

 

    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                using (Database db = new Database())
                {
                    db.ReadDwgFile(@"C:\Users\schwabg\Desktop\TSD-LY-306-9001-003.dwg.DWG", FileOpenMode.OpenForReadAndReadShare, false, "");

                    using (Transaction transaction = db.TransactionManager.StartTransaction())
                    {
                        foreach (DBObject obj in transaction.GetAllObjects())
                        {
                            ObjectId id = obj.Id;
                            BlockReference blockreference = (BlockReference)transaction.GetObject(id, OpenMode.ForRead);
                            //BlockTableRecord btr = (BlockTableRecord)transaction.GetObject(blkRef.BlockTableRecord, OpenMode.ForRead);
                            foreach (ObjectId attributeid in blockreference.AttributeCollection)
                            {
                                AttributeReference attributereference = (AttributeReference)transaction.GetObject(attributeid, OpenMode.ForRead);
                                Console.WriteLine("key: " + attributereference.Tag + "\n\t\t\tvalue: " + attributereference.TextString);
                            }
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }
        }
    }

 

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Construct wall centerline in the middle of wall

$
0
0

Hello, i need a lisp that construct line between two lines of wall by selection called  (Wall Centerline)

i attach example of what i want assuming that i will often isolate wall layer in the project to facilitate the task.

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Line on curved pline

$
0
0

Hy,

 

I have three offset curved pline. On one mid pline need to drawing all line that can be put on curved pline, and satisfy the following conditions:
- lenght of line is 10 (units)
- line must be without intersection, tangent of any other offset pline.

AutoCAD Customization: .NET: Veto ETRANSMIT command doesn't work

$
0
0

Hello,

 

I need to Veto ETRANSMIT in some cases, I stripped down my code to a msgbox that will ask if i want to Veto Or not

 

Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices

<Assembly: ExtensionApplication(GetType(GHATransmit.Initialization))> 

Namespace GHATransmit
    Public Class Initialization
        Implements IExtensionApplication
        Public KillCommand As Boolean = False

        Public Sub Initialize() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Initialize
            Dim dm As DocumentCollection = Application.DocumentManager
            Dim doc As Document = dm.MdiActiveDocument
            AddHandler doc.CommandWillStart, New CommandEventHandler(AddressOf StartCommand)

            AddHandler dm.DocumentCreated, New DocumentCollectionEventHandler(AddressOf InstallDoc)
            AddHandler dm.DocumentLockModeChanged, New DocumentLockModeChangedEventHandler(AddressOf LockModeChanged)
        End Sub

        Private Sub InstallDoc()
            Dim dm As DocumentCollection = Application.DocumentManager
            Dim doc As Document = dm.MdiActiveDocument
            AddHandler doc.CommandWillStart, New CommandEventHandler(AddressOf StartCommand)
        End Sub

        Private Sub LockModeChanged(ByVal sender As Object, ByVal e As DocumentLockModeChangedEventArgs)
            If KillCommand Then
                Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(vbLf & "VETO MY COMMAND (" & KillCommand & ")")
                KillCommand = False
                e.Veto()
            End If
        End Sub

        Public Sub Terminate() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Terminate

        End Sub

        Private Sub StartCommand(ByVal o As Object, ByVal e As CommandEventArgs)
            Try
                Dim oCName = e.GlobalCommandName
                If oCName = "ETRANSMIT" Then
                    If MsgBox("Do you want to Veto the ETRANSMIT command?", vbYesNo, "?") = vbYes Then
                        KillCommand = True
                    Else
                        KillCommand = False
                    End If
                End If
            Catch ex As Exception

            End Try
        End Sub
    End Class
End Namespace

 On my command line I can see that the e.veto is triggered.

------------------

VETO MY COMMAND (True)
Updating fields...
28 field(s) found
28 field(s) updated

-----------------

 

Even if the e.veto has been sent to AutoCAD the ETRANSMIT command still continues

 

AutoCAD Customization: .NET: using WMS + FDO for map laoding in AUD Modal Space

$
0
0

Hi ,

 

My project requires to WMS service for loading MAP in AUD Modal space by using FDO.I am able to connect to WMS service but don't able to show it in modal space.

 

I am using below for connect with WMS service.Please help how to show the map in AUD modal space.

 

 

publicvoidOpenWMSConnection()

{

IConnectionManager manager = FeatureAccessManager.GetConnectionManager();

 

using (IConnection connection = manager.CreateConnection("OSGeo.WMS.3.3"))

 

{

// Get the property dictionary for the connection

IConnectionPropertyDictionaryprops =connection.ConnectionInfo.ConnectionProperties;

props.SetProperty("FeatureServer", "*******");

props.SetProperty("Username", "*****");

props.SetProperty("Password", "*****");

props.SetProperty("DefaultImageHeight", "******");

 try

{

OSGeo.FDO.Connections.

ConnectionStateconnState = connection.Open();

 

if (connState != OSGeo.FDO.Connections.ConnectionState.ConnectionState_Open)

 {

MessageBox.Show("Connect to the feature source");

 

//// need to write some code to laod map in AUD modal space ( please help )

 

}

}

catch (OSGeo.FDO.Common.Exceptionex)

{

MessageBox.Show(ex.StackTrace);

}

}

}

 

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Link attributed block with polyline to get Area

$
0
0

Hey guys,

 

I'd like to set up a blockwith different attributes like Roomname, Floor, Area,...

Therefore I'd like to link a polyline of the drawing with the block and it shows me its area. I know how it works with fields, but not how to connect it when the field is within a block.

Is there a LISP for that?

 

Thanks for any help! :smileyhappy:


AutoCAD Customization: .NET: text rotation

$
0
0
Text = New DBText
                Text.SetDatabaseDefaults()
                Text.Height = 2.25 * Application.GetSystemVariable("DIMSCALE")
                Text.Rotation = 300
                Text.TextString = coord
                Text.Layer = "GRID-TEXT"
Text.TextStyleId = newTSId If MIR = True Then Text.HorizontalMode = TextHorizontalMode.TextRight Text.VerticalMode = TextVerticalMode.TextBottom Else Text.HorizontalMode = TextHorizontalMode.TextLeft Text.VerticalMode = TextVerticalMode.TextBottom End If Text.AlignmentPoint = pt If ucs = True Then Text.TransformBy(Doc.Editor.CurrentUserCoordinateSystem) End If btr.AppendEntity(Text) tr.AddNewlyCreatedDBObject(Text, True) tr.Commit()

 

when placing text the rotation is off in autocad, i set it to 300 and in autocad it should be 270 degrees it is 269. am i doing something wrong?

 

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Cube unknown in lisp, but works from Command line ACAD2012

$
0
0

I'm running AutoCAD 2012 (base version, but part of Mechanical install). Part of my .mnl file is set to run (command "cube" "off"). On one machine (Windows 7), it works fine. I'm temporarily on my laptop (Windows 8), & that portion no longer works.

 

If I type cube in the command line, it works fine. However, if I type (command "cube"), it says unknown command "CUBE".

 

Any ideas how to fix this?

AutoCAD Customization: .NET: Can you call a CadWorx Line command from a .Net AutoCad addin?

$
0
0

I need to call the GROUPTOG, which is a CadWorx command, from my .Net AddIn.  Is this possible, and if so, how would one do it?

 

Thanks,

Neil

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: stream linestyle

$
0
0

Hi all,

 

I am trying to create a custom complex linestyle for a stream. It's a line with 3 circles/dots. For the dots I want to actually create the circles. I know how to create shapes, compile and load linestyles. For some reason it does not work. Would appreciate any help.

 

Thanks!

Christina

 


*STREAM-UCS, WATER BODIES -----ooo-----ooo-----ooo-----ooo-----
A,.6,-.15,[STREAM,ucs-ltype.shx,x=0,s=1],-.15

 

 

*1,1927,STREAM 4,250,4,4,3,167,3,13,3,176,002,9,(-51,0),(0,0),001,9,(0,3),(-3,3),(-1,0),(-1,1),(-2,0),(-1,-1),(-1,0),(-1,-1),(-1,0),(-1,-1) (0,-1),(-1,-1),(0,-4),(1,-1),(0,-1),(2,-2),(2,0),(1,-1),(2,0),(1,1),(1,0),(1,1),(1,0),(0,1),(1,1),(0,3),(0,0),002,9,(-3,-6) (0,0),001,9,(2,2),(0,0),002,9,(-2,-2),(0,0),001,9,(2,3),(0,0),002,9,(-2,-3),(0,0),001,9,(3,3),(0,0),002,9,(-4,-3),(0,0) 001,9,(4,3),(0,0),002,9,(-4,-3),(0,0),001,9,(4,4),(0,0),002,9,(-4,-4),(0,0),001,9,(4,4),(0,0),002,9,(-4,-4),(0,0),001 9,(4,4),(0,0),002,9,(-5,-4),(0,0),001,9,(5,4),(0,0),002,9,(-5,-5),(0,0),001,9,(5,6),(0,0),002,9,(-5,-6),(0,0),001,9,(5,6) (0,0),002,9,(-5,-6),(0,0),001,9,(5,6),(0,0),002,9,(-6,-6),(0,0),001,9,(6,6),(0,0),002,9,(-6,-6),(0,0),001,9,(6,6),(0,0) 002,9,(-6,-6),(0,0),001,9,(6,7),(0,0),002,9,(-6,-7),(0,0),001,9,(6,7),(0,0),002,9,(-6,-7),(0,0),001,9,(6,7),(0,0),002 9,(-6,-7),(0,0),001,9,(6,7),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7) (0,0),001,9,(7,8),(0,0),002,9,(-7,-8),(0,0),001,9,(7,8),(0,0),002,9,(-7,-8),(0,0),001,9,(7,8),(0,0),002,9,(-7,-8),(0,0) 001,9,(7,8),(0,0),002,9,(-7,-8),(0,0),001,9,(7,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001 9,(8,8),(0,0),002,9,(-8,-7),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8) (0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-9,-8),(0,0),001,9,(9,8),(0,0) 002,9,(-9,-8),(0,0),001,9,(9,8),(0,0),002,9,(-9,-8),(0,0),001,9,(9,8),(0,0),002,9,(-9,-8),(0,0),001,9,(9,9),(0,0),002 9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9) (0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-10,-9),(0,0),001,9,(10,9),(0,0),002,9,(-10,-9),(0,0) 001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,10),(0,0),002,9,(-9,-10),(0,0),001,9,(9,10),(0,0),002,9,(-9,-10),(0,0) 001,9,(9,10),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001 9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-10,-9),(0,0),001,9,(10,9),(0,0),002,9,(-10,-9),(0,0),001,9 (10,9),(0,0),002,9,(-10,-9),(0,0),001,9,(10,9),(0,0),002,9,(-10,-9),(0,0),001,9,(10,9),(0,0),002,9,(-10,-9),(0,0),001 9,(10,10),(0,0),002,9,(-10,-10),(0,0),001,9,(9,10),(0,0),002,9,(-9,-10),(0,0),001,9,(9,10),(0,0),002,9,(-9,-10),(0,0) 001,9,(9,10),(0,0),002,9,(-9,-10),(0,0),001,9,(9,10),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001 9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-10,-9),(0,0),001,9,(10,9),(0,0),002,9,(-10,-9),(0,0),001,9 (10,9),(0,0),002,9,(-10,-9),(0,0),001,9,(10,9),(0,0),002,9,(-10,-9),(0,0),001,9,(10,9),(0,0),002,9,(-10,-9),(0,0),001 9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,10),(0,0),002,9,(-9,-10),(0,0),001,9,(9,10),(0,0),002,9,(-9,-10),(0,0),001 9,(9,10),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9) (0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0) 002,9,(-9,-9),(0,0),001,9,(8,9),(0,0),002,9,(-8,-9),(0,0),001,9,(8,9),(0,0),002,9,(-9,-8),(0,0),001,9,(9,8),(0,0),002 9,(-9,-8),(0,0),001,9,(9,8),(0,0),002,9,(-9,-8),(0,0),001,9,(9,8),(0,0),002,9,(-9,-8),(0,0),001,9,(9,8),(0,0),002,9,(-9,-8) (0,0),001,9,(9,8),(0,0),002,9,(-9,-8),(0,0),001,9,(9,8),(0,0),002,9,(-9,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0) 001,9,(8,8),(0,0),002,9,(-8,-7),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001 9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(7,8) (0,0),002,9,(-7,-8),(0,0),001,9,(7,8),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7),(0,0) 002,9,(-7,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(6,7),(0,0),002 9,(-6,-7),(0,0),001,9,(6,7),(0,0),002,9,(-6,-6),(0,0),001,9,(6,6),(0,0),002,9,(-6,-6),(0,0),001,9,(6,6),(0,0),002,9,(-6,-6) (0,0),001,9,(6,6),(0,0),002,9,(-6,-6),(0,0),001,9,(5,6),(0,0),002,9,(-5,-6),(0,0),001,9,(5,6),(0,0),002,9,(-5,-5),(0,0) 001,9,(5,4),(0,0),002,9,(-5,-4),(0,0),001,9,(5,4),(0,0),002,9,(-5,-4),(0,0),001,9,(5,4),(0,0),002,9,(-5,-4),(0,0),001 9,(4,4),(0,0),002,9,(-3,-3),(0,0),001,9,(3,3),(0,0),002,9,(-3,-3),(0,0),001,9,(3,3),(0,0),002,9,(-3,-3),(0,0),001,9,(2,3) (0,0),002,9,(-2,-2),(0,0),001,9,(2,2),(0,0),002,9,(125,-6),(0,0),001,9,(0,2),(-1,1),(0,1),(-1,1),(-1,0),(-1,1),(-1,0) (-1,1),(-2,0),(-1,-1),(-1,0),(-3,-3),(0,-6),(3,-3),(1,0),(1,-1),(3,0),(1,1),(1,0),(0,1),(1,0),(1,1),(0,1),(1,1),(0,2) (0,0),002,9,(-3,-6),(0,0),001,9,(2,2),(0,0),002,9,(-2,-2),(0,0),001,9,(2,3),(0,0),002,9,(-3,-3),(0,0),001,9,(3,3),(0,0) 002,9,(-3,-3),(0,0),001,9,(3,3),(0,0),002,9,(-3,-3),(0,0),001,9,(4,4),(0,0),002,9,(-5,-4),(0,0),001,9,(5,4),(0,0),002 9,(-5,-4),(0,0),001,9,(5,4),(0,0),002,9,(-5,-4),(0,0),001,9,(5,4),(0,0),002,9,(-5,-5),(0,0),001,9,(5,6),(0,0),002,9,(-5,-6) (0,0),001,9,(5,6),(0,0),002,9,(-6,-6),(0,0),001,9,(6,6),(0,0),002,9,(-6,-6),(0,0),001,9,(6,6),(0,0),002,9,(-6,-6),(0,0) 001,9,(6,6),(0,0),002,9,(-6,-6),(0,0),001,9,(6,7),(0,0),002,9,(-6,-7),(0,0),001,9,(6,7),(0,0),002,9,(-7,-7),(0,0),001 9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7) (0,0),002,9,(-7,-7),(0,0),001,9,(7,8),(0,0),002,9,(-7,-8),(0,0),001,9,(7,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0) 002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002 9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-7),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-9,-8) (0,0),001,9,(9,8),(0,0),002,9,(-9,-8),(0,0),001,9,(9,8),(0,0),002,9,(-9,-8),(0,0),001,9,(9,8),(0,0),002,9,(-9,-8),(0,0) 001,9,(9,8),(0,0),002,9,(-9,-8),(0,0),001,9,(9,8),(0,0),002,9,(-9,-8),(0,0),001,9,(9,8),(0,0),002,9,(-9,-8),(0,0),001 9,(8,9),(0,0),002,9,(-8,-9),(0,0),001,9,(8,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),4,176,4 13,4,167,3,4,3,250,7,2,0

 

*2,1929,STREAM_SUBSHAPE_1 4,250,4,4,3,167,3,13,3,176,002,9,001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9) (0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,10),(0,0) 002,9,(-9,-10),(0,0),001,9,(9,10),(0,0),002,9,(-9,-10),(0,0),001,9,(9,10),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0) 002,9,(-10,-9),(0,0),001,9,(10,9),(0,0),002,9,(-10,-9),(0,0),001,9,(10,9),(0,0),002,9,(-10,-9),(0,0),001,9,(10,9),(0,0) 002,9,(-10,-9),(0,0),001,9,(10,9),(0,0),002,9,(-10,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002 9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,10),(0,0),002,9,(-9,-10),(0,0),001,9,(9,10),(0,0),002,9 (-9,-10),(0,0),001,9,(9,10),(0,0),002,9,(-9,-10),(0,0),001,9,(9,10),(0,0),002,9,(-10,-10),(0,0),001,9,(10,10),(0,0),002 9,(-10,-9),(0,0),001,9,(10,9),(0,0),002,9,(-10,-9),(0,0),001,9,(10,9),(0,0),002,9,(-10,-9),(0,0),001,9,(10,9),(0,0),002 9,(-10,-9),(0,0),001,9,(10,9),(0,0),002,9,(-10,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9 (-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,10),(0,0),002,9,(-9,-10) (0,0),001,9,(9,10),(0,0),002,9,(-9,-10),(0,0),001,9,(9,10),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-10,-9) (0,0),001,9,(10,9),(0,0),002,9,(-10,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0) 001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001 9,(9,9),(0,0),002,9,(-9,-8),(0,0),001,9,(9,8),(0,0),002,9,(-9,-8),(0,0),001,9,(9,8),(0,0),002,9,(-9,-8),(0,0),001,9,(9,8) (0,0),002,9,(-9,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0) 002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-7),(0,0),001,9,(8,8),(0,0),002 9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(7,8),(0,0),002,9,(-7,-8),(0,0),001,9,(7,8),(0,0),002,9,(-7,-8) (0,0),001,9,(7,8),(0,0),002,9,(-7,-8),(0,0),001,9,(7,8),(0,0),002,9,(-7,-8),(0,0),001,9,(7,8),(0,0),002,9,(-7,-7),(0,0) 001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(6,7),(0,0),002,9,(-6,-7),(0,0),001 9,(6,7),(0,0),002,9,(-6,-7),(0,0),001,9,(6,7),(0,0),002,9,(-6,-7),(0,0),001,9,(6,7),(0,0),002,9,(-6,-6),(0,0),001,9,(6,6) (0,0),002,9,(-6,-6),(0,0),001,9,(6,6),(0,0),002,9,(-6,-6),(0,0),001,9,(5,6),(0,0),002,9,(-5,-6),(0,0),001,9,(5,6),(0,0) 002,9,(-5,-6),(0,0),001,9,(5,6),(0,0),002,9,(-5,-5),(0,0),001,9,(5,4),(0,0),002,9,(-5,-4),(0,0),001,9,(4,4),(0,0),002 9,(-4,-4),(0,0),001,9,(4,4),(0,0),002,9,(-4,-4),(0,0),001,9,(4,4),(0,0),002,9,(-4,-3),(0,0),001,9,(4,3),(0,0),002,9,(-4,-3) (0,0),001,9,(3,3),(0,0),002,9,(-2,-3),(0,0),001,9,(2,3),(0,0),002,9,(-2,-2),(0,0),001,9,(2,2),(0,0),002,9,(-47,-6),(0,0) 001,9,(0,1),(-1,1),(0,1),(-1,1),(0,1),(-1,0),(-1,1),(-1,0),(-1,1),(-2,0),(-1,-1),(-1,0),(-1,-1),(-1,0),(0,-1),(-1,-1) (0,-1),(-1,-1),(0,-2),(1,-1),(0,-1),(1,-1),(0,-1),(1,-1),(2,0),(1,-1),(2,0),(1,1),(1,0),(1,1),(1,0),(1,1),(0,2),(1,1) (0,1),(0,0),002,9,(-3,-6),(0,0),001,9,(2,2),(0,0),002,9,(-3,-2),(0,0),001,9,(3,3),(0,0),002,9,(-3,-3),(0,0),001,9,(3,3) (0,0),002,9,(-3,-3),(0,0),001,9,(3,3),(0,0),002,9,(-4,-3),(0,0),001,9,(4,4),(0,0),002,9,(-4,-4),(0,0),001,9,(4,4),(0,0) 002,9,(-4,-4),(0,0),001,9,(4,4),(0,0),002,9,(-4,-4),(0,0),001,9,(4,4),(0,0),002,9,(-5,-5),(0,0),001,9,(6,6),(0,0),002 9,(-6,-6),(0,0),001,9,(6,6),(0,0),002,9,(-6,-6),(0,0),001,9,(6,6),(0,0),002,9,(-6,-6),(0,0),001,9,(6,6),(0,0),002,9,(-6,-6) (0,0),001,9,(6,6),(0,0),002,9,(-7,-6),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7),(0,0) 001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001 9,(7,7),(0,0),002,9,(-8,-7),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8) (0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0) 002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-9,-7),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002 9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8) (0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-9,-8),(0,0) 001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001 9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9) (0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-10,-9),(0,0),001,9,(10,10),(0,0),002,9,(-10,-10),(0,0),001,9,(10,10) (0,0),002,9,(-10,-10),(0,0),001,9,(10,10),(0,0),002,9,(-10,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9) (0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0) 002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002 9,(-10,-9),(0,0),001,9,(10,10),(0,0),002,9,(-10,-10),(0,0),001,9,(10,10),(0,0),002,9,(-10,-10),(0,0),001,9,(10,10),(0,0) 002,9,(-10,-10),(0,0),001,9,(10,10),(0,0),002,9,(-10,-10),(0,0),001,9,(10,10),(0,0),002,9,(-10,-9),(0,0),001,9,(9,9),(0,0) 002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002 9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9) (0,0),001,9,(9,9),(0,0),002,9,(-10,-9),(0,0),001,9,(10,10),(0,0),002,9,(-10,-10),(0,0),001,9,(10,10),(0,0),002,9,(-10,-10) (0,0),001,9,(10,10),(0,0),002,9,(-10,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0) 001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001 9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-9),(0,0),001,9,(9,9),(0,0),002,9,(-9,-8),(0,0),001,9,(8,8) (0,0),002,9,(-8,-8),(0,0),4,176,4,13,4,167,3,4,3,250,7,3,0

 

*3,420,STREAM_SUBSHAPE_2 4,250,4,4,3,167,3,13,3,176,002,9,001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8) (0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0) 002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-9,-7),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002 9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-8) (0,0),001,9,(8,8),(0,0),002,9,(-8,-8),(0,0),001,9,(8,8),(0,0),002,9,(-8,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7),(0,0) 001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-7),(0,0),001 9,(7,7),(0,0),002,9,(-7,-7),(0,0),001,9,(7,7),(0,0),002,9,(-7,-6),(0,0),001,9,(6,6),(0,0),002,9,(-6,-6),(0,0),001,9,(6,6) (0,0),002,9,(-6,-6),(0,0),001,9,(6,6),(0,0),002,9,(-6,-6),(0,0),001,9,(6,6),(0,0),002,9,(-6,-6),(0,0),001,9,(6,6),(0,0) 002,9,(-5,-5),(0,0),001,9,(4,4),(0,0),002,9,(-4,-4),(0,0),001,9,(4,4),(0,0),002,9,(-4,-4),(0,0),001,9,(4,4),(0,0),002 9,(-4,-4),(0,0),001,9,(4,4),(0,0),002,9,(-4,-3),(0,0),001,9,(3,3),(0,0),002,9,(-3,-3),(0,0),001,9,(3,3),(0,0),002,9,(-3,-3) (0,0),001,9,(3,3),(0,0),002,9,(-3,-2),(0,0),001,9,(2,2),(0,0),002,9,(4,-6),(0,0),001,4,176,4,13,4,167,3,4,3,250,0

 

AutoCAD Customization: .NET: AutoLisp Integration with Database.SaveAs results in eFileAccessErr

$
0
0

Hey all,

 

I've been having some strange things happen ever since I changed my program to start from AutoLisp rather than a command.

 

Below I will describe what happens when I call Document.CloseAndSave and Database.SaveAs when I run my program from either AutoLisp or from a command.

 

 

AutoLisp

Method Attribute:

[LispFunction("BOMGEN")]

When I call Database.SaveAs(), I get an eFileAccessErr and a message box pops us saying "Error Writing/Closing File"

 

When I call Document.CloseAndSave(), while omitting Database.SaveAs(), my drawing appears to close properly expect I find that when I open it back up no changes were saved!

 

 

 

Command:

Method Attribute:

[CommandMethod("BOMGEN", CommandFlags.Session)]

 

When I call Database.SaveAs(), my drawing saves properly.

 

When I call Document.CloseAndSave(), in succession with Database.SaveAs(), the drawing closes (no idea if it actually saves twice, but to be honest I don't care!  Once is all I need.)  

 

 

So, I'm looking to run my program from an AutoLisp command:

(bomgen)

However, I cannot save the drawings using the methods described above. Is there an alternate way to save drawings? Or do I need to make further steps when switching to an AutoLisp command?

 

 

I believe I read something that generally stated that .NET dlls had some quirks when used from AutoLisp regarding connectivity to the Documents collection.  I don't know where I read this or if it's accurate, but in case it helps, I've got it up here! :)

 

 

Thanks much,

-Nicholas

AutoCAD Customization: .NET: font and shx file validation

$
0
0

Hi,
I have a rquirement to valdiate my dwg file with ObjectARX dll (accoreconsole dll) . I want to now if a font is not availble log the error. 
Any clue what should I do?

I  used

private static void FontValidator(Database db, Transaction tr)
{
TextStyleTable styleTable = tr.GetObject(db.TextStyleTableId, OpenMode.ForRead) as TextStyleTable;
foreach (var item in styleTable)
{
TextStyleTableRecord styleRecord = item.GetObject(OpenMode.ForRead) as TextStyleTableRecord;

//s.Current.FindFile(styleRecord.FileName,db,FindFileHint.Default)
if (!string.IsNullOrEmpty(styleRecord.Font.TypeFace))//TrueType Font
{
if (!System.Drawing.FontFamily.Families.Any(font => font.Name.Contains(styleRecord.Font.TypeFace)))
System.Windows.Forms.MessageBox.Show("Font : " + styleRecord.Font.TypeFace + "Not found");
}
// styleRecord
}
}

to go all StyleTableRecord but was not succesful to find my used font just there was 4 records

Am I doing the iteration in the right way ? How can I iteraret whole TextStyleTableRecord  in the DWG file?
Any other way to get the result?

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Insert blocks at XYZ coordinates and x-, y- and z-scales from ASCII

$
0
0

I found this LISP code that can insert a block at coordinates from an ASCII.

 

(defun c:universal( / file f a osmode);PointsToBlocks
(while (not file)
(setq file (getfiled "Input file" "coords" "txt" 4))
)
(setq f (open file "r")
osmode (getvar "OSMODE")
)
(setvar "OSMODE" 0)
(while (setq a (read-line f))
(command "._insert" "block1" a 1 1 0)
)
(setvar "OSMODE" osmode)
(princ)

What I want to be able to do is insert blocks from an ASCII and also set the x-, y-, and z-scales.

 

For example, I have these lines in ASCII, the data points refer to X position, Y position, Z position, X scale, Y scale, and Z scale.

 

30.593589,21.274607,26.235255,0.172826,0.766324,0.066442
30.710182,21.379792,27.054248,0.130816,0.700035,0.043114

 

Thank you in advance for your help, I am a beginner.


AutoCAD Customization: .NET: [Help] code show/hide DataGridView this image

$
0
0

Hello all.

Do you help me question sample code vb.net show/hile datagridview this image or control API autocad

Thank you and holp everybody help me.

 

 

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: TQ block insertion

$
0
0

looking for a lisp to do the following,

 

you can click within CAD to where you need the TQ tile (OSBASE) and it places the correct tile (block) in the correct location.

 

i have all the TQ tiles as blocks in a folder and they are all in the correct location labled tq3145 etc etc.

 

i used to have a lsp that did this but have lost it :(

 

any help would be greeat!

AutoCAD Customization: Visual Basic Customization: Sample *.dvb files in AutoCAD

$
0
0

Hi all,

 

The sample -ExcelLink.dvb file in C:\Program Files\Autodesk\AutoCAD 2009\Sample\VBA requires to be run with Microsoft Office 97 or 2000.

 

Does any one have an option of how to run it in Microsoft Office 2007 or 2003.

 

This dvb file creates BOM based on the entities selected (as mentioned in readme file)

 

Can any one help on this. I am new to this subject.

AutoCAD Customization: .NET: (C#) How to create multiline attribute?

$
0
0

My method creates a attribute, how to a create a multi-line attribute?
Please Help!!!

 

using (Transaction trAdding = dbCurrent.TransactionManager.StartTransaction())
                    {
                        BlockTable btTable = (BlockTable)trAdding.GetObject(dbCurrent.BlockTableId, OpenMode.ForRead);
                        string strBlockName = "ATTRBLK" + System.Convert.ToString(blockName);
                        try
                        {
                            if (btTable.Has(strBlockName))
                                edCurrent.WriteMessage("\n A block with this name already exist.");
                        }
                        catch
                        {
                            edCurrent.WriteMessage("\n Invalid block name.");
                        }

                        
                        AttributeDefinition adAttr = new AttributeDefinition();
                        adAttr.Position = new Point3d(x, y, 0);
                        adAttr.WidthFactor = widthFactor;
                        adAttr.Height = height;
                        adAttr.Rotation = rotate;
                        adAttr.Oblique = oblique;

                        adAttr.Tag = attrName;

                        BlockTableRecord btrRecord = new BlockTableRecord();
                        btrRecord.Name = strBlockName;
                        btTable.UpgradeOpen();

                        ObjectId btrID = btTable.Add(btrRecord);

                        trAdding.AddNewlyCreatedDBObject(btrRecord, true);

                        btrRecord.AppendEntity(adAttr);
                        trAdding.AddNewlyCreatedDBObject(adAttr, true);

                        BlockTableRecord btrPapperSpace = (BlockTableRecord)trAdding.GetObject(btTable[BlockTableRecord.PaperSpace], OpenMode.ForWrite);

                        BlockReference brRefBlock = new BlockReference(Point3d.Origin, btrID);

                        btrPapperSpace.AppendEntity(brRefBlock);
                        trAdding.AddNewlyCreatedDBObject(brRefBlock, true);

                        //задаём значение атрибута
                        AttributeReference arAttr = new AttributeReference();
                        arAttr.SetAttributeFromBlock(adAttr, brRefBlock.BlockTransform);

                        arAttr.TextString = text;
                        arAttr.Layer = "Z-TEXT";

                        brRefBlock.AttributeCollection.AppendAttribute(arAttr);


                        trAdding.AddNewlyCreatedDBObject(arAttr, true);

                        trAdding.Commit();
                    }

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: passing a list of points to a lisp function instead of user unput

$
0
0

Hello.

 

I have a list function that asks for the user to pick points when it is run. It looks something like this...

 

(foo arg1 arg2) 

 

When invoked it asks the user to pick points and press enter when done It.

 

Instead of getting the points from the user i want to pass it a list of pre-defined points. The code cannot be changed so I must use it as is.

 

 

Is this possible, if so how can it be done? I will be very grateful for any suggestions. 

Thank you in advance.

Viewing all 1680 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>