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

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Extracting attribute values and assigning to variables

$
0
0

How can specific attribute values be extracted from a drawing and assigned to a variable in lisp. 

The existing title block is having attributes : Area, Sub area, Description, Drawing type. I want to extract this values and assign it to some variable which I have already listed and then it shall be assigned to some other attributes in the same drawing with Area1, Subarea1, Description1, Drawing type1... and so on.. Both the attributes shall be in the same drawing file.

Any idea.....


AutoCAD Customization: .NET: How to code a drop-down list for a custom property using OPM and .NET/C# ?

$
0
0

Hi all!

 

I am mainly developing for AutoCAD 2013/2014 and I need some help to understand how to implement a custom property as a drop-down list using OPM and .NET/C# wrapper. I have successfully created categorized custom properties already and can read/save them in XRecords via the OPM. I further implemented the members for IDynamicEnumProperty (using an ObjectARX DLL) in .NET/C# which are:

 

// ENUM-PROPERTY INTERFACE METHODS DEFINITION
enum myEnum
{
  steel = 0,
  copper,
  wood
};

public void GetNumPropertyValues( int numValues )
{
  numValues = 3;
}

public void GetPropValueName( int index, out String valueName )
{
  valueName = Enum.GetName(typeof(myEnum), index);
}

public void GetPropValueData( int index, ref Object valueName )
{
  valueName = index;
}

 

And I have implemented the GetCurrentValueData() and SetCurrentValueData() members in my .NET/C# wrapper as per the IDynamicProperty2 interface as following:

 

public void GetCurrentValueData( Object pUnk, ref Object varData )
        {
            AcadObject obj = pUnk as AcadObject;
            if ( obj != null )
            {
                using ( Active.Document.LockDocument( DocumentLockMode.ProtectedAutoWrite, null, null, true ) )
                {
                    using ( var tr = Active.Transaction )
                    {
                        ObjectId ObjId = new ObjectId( (IntPtr) obj.ObjectID );
                        DBObject DbObj = tr.GetObject( ObjId, OpenMode.ForRead );
                        if ( DbObj != null )
                        {
                            try
                            {
                                if ( !DbObj.ExtensionDictionary.IsNull )
                                {
                                    DBDictionary xDict = tr.GetObject( DbObj.ExtensionDictionary, OpenMode.ForRead, false ) as DBDictionary;

                                    Xrecord xRec = new Xrecord();
                                    xRec = tr.GetObject( xDict.GetAt( "myEnum" ), OpenMode.ForRead, false ) as Xrecord;

                                    ResultBuffer resbuf = xRec.Data;
                                    if ( resbuf != null )
                                    {
                                        TypedValue[] result = resbuf.AsArray();
                                        varData = (myEnum) Enum.ToObject( typeof( myEnum ), result[ 0 ].Value );
                                        //varData = (int) result[ 0 ].Value;
                                        return;
                                    }
                                }
                            }
                            catch ( Autodesk.AutoCAD.Runtime.Exception e )
                            {
                                Console.Write( e );
                                tr.Abort();
                            }
                        }
                    }
                }
            }
        }

public void SetCurrentValueData( Object pUnk, Object varData ) { AcadObject obj = pUnk as AcadObject; if ( obj != null ) { using ( Active.Document.LockDocument( DocumentLockMode.ProtectedAutoWrite, null, null, true ) ) { using ( var tr = Active.Transaction ) { ObjectId ObjId = new ObjectId( (IntPtr) obj.ObjectID ); DBObject DbObj = tr.GetObject( ObjId, OpenMode.ForWrite ); if ( DbObj.ExtensionDictionary.IsNull ) DbObj.CreateExtensionDictionary(); if ( DbObj != null ) { DbObj.UpgradeOpen(); DBDictionary xDict = tr.GetObject( DbObj.ExtensionDictionary, OpenMode.ForWrite ) as DBDictionary; // the value 70 denotes an integer value ResultBuffer resBuf = new ResultBuffer( new TypedValue(70, myEnum.Wood) ); Xrecord xRec = new Xrecord(); xRec.Data = resBuf; xDict.SetAt( "myEnum", xRec ); tr.AddNewlyCreatedDBObject( xRec, true ); tr.Commit(); } else { tr.Abort(); } } } } m_pSink.OnChanged( this ); }

 

This code compiles without error but instead of the expected drop-down list the OPM only shows a field where I can enter or edit integer numbers, but there is no drop-down list when clicking on the field.No idea why this does not work ... :smileysad:

 

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Attribute update.

$
0
0

Attached is the drawing.
The project scope is to convert the existing drawing (title block is shown on the right side) to new format with the new title block ( on the left side).
I am trying to automate these information in to the new one to avoid typing mistakes and to make it easier.
Both the blocks will be there in the same drawing side by side. As the first step I am looking for a code to take the attribute value of area from the existing block and update the attribute value in the new title block.

AutoCAD Customization: .NET: Dymanic block manipulation after changing UCS

$
0
0

The dynamic position and angle parameters within the inserted blocks appear to be based on the UCS at the time of insertion and relative to the basepoint of the block. These positions don’t change if the UCS is changed or block is rotated.

I can’t work out how to modify the position parameters if the UCS is not the same as that used when the block was inserted.

 

Can anyone suggest how I access these positions after changing the UCS?

 

I’ve tried looking at the ECS of the block reference but I’m not sure if that’s what I need to be using.

AutoCAD Customization: .NET: Dymanic block manipulation after changing UCS

$
0
0

The dynamic position and angle parameters within the inserted blocks appear to be based on the UCS at the time of insertion and relative to the basepoint of the block. These positions don’t change if the UCS is changed or block is rotated.

I can’t work out how to modify the position parameters if the UCS is not the same as that used when the block was inserted.

 

Can anyone suggest how I access these positions after changing the UCS?

 

I’ve tried looking at the ECS of the block reference but I’m not sure if that’s what I need to be using.

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Create ONLY a custom shortcut during deployment

$
0
0

Hello, hope this is the best place to post this.

 

I'm creating a deployment for AutoCAD 2014.

 

At the end of the deploy process I'd like to end up with a custom AutoCAD shortcut on the desktop that calls an ARG file.  This is no problem.

 

The problem is that to get that shortcut I need to check the "create desktop shortcut" check box and then I wind up with 2 shortcuts on the desktop, the default "AutoCAD 2014 - English" and my custom shortcut.

 

Is it all or nothing or is there a way to do this?

 

Thanks in advance for your help.

 

 

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Include 360 in a deployment without a restart message?

$
0
0

Hi,

 

I'm trying to include the Autodesk 360 SP1 in my 2014 deployment.  Its working fine but it prompts for a restart and I'd rather not require user action to complete the install. (the users here restart frequently enough to deal with this anyway)

 

I have tried the following switches in the parameters section to no avail:

 

/s /qn

/s /v/qn

/s qn "REBOOT = ReallySupress"

/s /v/qn "REBOOT = ReallySupress"

 

Any thoughts?

 

Thanks.

 

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Opening drawings with Lisp

$
0
0

Hello All:

 

I have a bit of code that basically allows me to pick a symbol off the screen that includes an attribute that refers to another drawing.  The referenced drawing is then supposed to open.  Here's a chunk of the funtion:

 

(cond

  (switch_filename (progn
    (vl-load-com)
    (setq acadDocs (vla-Get-Documents (vlax-get-acad-object)))
    (setq newDoc (vla-Open acadDocs switch_filename))
    (vla-Activate newDoc)
                   )
  )
)

 

Here's my problem:  If I open a folder and double click into a file and then run the routine it works fine.  If I open a drawing in a folder other than the one I started in (all of these folders are on our network) newDoc returns nil and the function fails.  I'm kind of a newbie when it comes to the vla and vlax extensions to AutoLISP.

 

Any help would be appreciated.

 

Mark


AutoCAD Customization: .NET: Creating Socketweld connection in Plant3D

$
0
0

Hello,

I'm trying to create a assembly with .NET to draw all objects from a chosen spec. I started from Plant3D SDK which have a sample project. Autodesk ADN support is too slow to answer some basic questions since they have changed support platform recently. So, I hope someone can help me here. :smileywink:
After hours searching and trying to reach the main goal, I understood how connections between objects are done. The connector is based on End Type of objects. I'm not a meterial guy, so everything is much more difficult to me :smileysad:
At CreatePipeline (..\Plant SDK 2013\Samples\Piping\CreatePipeline) sample we have a class PipelineConnector which create connector. The main problem is only Buttweld connector code is available at CreatePart method in this class. I'm needing a piece of code where creation for others connector types such as Socketweld are shown.
Please, any help is very very appreciated.

the CreatePart code below:

 

public override void CreatePart()
        {
            Database db = AcadApp.DocumentManager.MdiActiveDocument.Database;
            ContentManager cm = ContentManager.GetContentManager();

            part.Position = InsertPoint;
            part.SlopeTolerance = 0.1;
            part.OffsetTolerance = 0.0;

            if (ConnTypeName.Equals("Gasket"))
            {
                // Gasket
                //
                //PartName = "Gasket";
                var spGPart = GetSpecPart("Gasket");
                PSPColl.Add(spGPart);

                var blockSubPart = new BlockSubPart();
                ObjectId Id = ObjectId.Null;
                try
                {
                    if (spGPart.PropValue("ContentGeometryParamDefinition") != null)
                        Id = cm.GetSymbol(spGPart, db);
                    blockSubPart.SymbolId = Id;
                }
                catch { }

                part.AddSubPart(blockSubPart);

                // BoltSet
                // 
                var spBPart = GetSpecPart("BoltSet");

                BoltSetSubPart boltsetSubPart = new BoltSetSubPart();
                boltsetSubPart.PartSizeProperties.NominalDiameter = NomDia;
                boltsetSubPart.Length = NomDia.Value * 2;
                part.AddSubPart(boltsetSubPart);                
                
                PSPColl.Add(spBPart);
            }
            else if (ConnTypeName.Equals("Buttweld"))
            {
                Project activeProject = PlantApp.CurrentProject.ProjectParts["Piping"];
                PartSizeProperties psprops = new NonSpecPart();
                psprops.Name = "Buttweld";
                psprops.NominalDiameter = NomDia;
                psprops.Type = "Buttweld";
                psprops.Spec = SpecName;

                Double dWeldGap = 0;
                String bWeldGap = String.Empty;
                activeProject.GetProjectVariable("USEWELDGAPS", out bWeldGap);
                if (String.Compare("TRUE", bWeldGap, true) == 0)
                {
                    String sWeldGap = String.Empty;
                    activeProject.GetProjectVariable("WELDGAPSIZE", out sWeldGap);
                    if (!String.IsNullOrEmpty(sWeldGap))
                    {
                        Double.TryParse(sWeldGap, out dWeldGap);
                    }
                }

                WeldSubPart weldSubPart = new WeldSubPart();
                weldSubPart.Width = dWeldGap;
                part.AddSubPart(weldSubPart);
                PSPColl.Add(psprops);
            }
            
            PartObject = part;
        }

 

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Open xref in selected layout and zoom to match view?

$
0
0

I have used Autocad since 1991, and my current job required me to use Microstation. One feature I liked from Microstaiton is the ability to select and open an external DGN reference, and then match the view of the parent DGN. In AutoCAD, you can also select and open an xref, but the DWG opens to the previous saved view, and not to the desired view that matches the layout.

 

My thought was to experienting with lisp or scipt and export the "Viewctr", "Viewtwist" and "Viewsize" variables to a text file, then importing the text file and using the "Viewtwist" as my "SNAPANG" value, then "Viewctr" as my "ZOOM, CENTER" value, and finally the "Viewsize" as the "Enter magnification or height:" value.

 

But, alas, have no time, and not quite the knowledge to duplicate MicroStation's open-xref-and-zoom-to-view feature.

 

Anybody tried something like this?

 

Jorge Chavez

Acting Autodesk CAD Manager

City of Austin Public Works - Engineering Services Division

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Extract Elevations of Polylines

$
0
0

Hi,

 

Can someone tell me or whip me up a quick lisp routine to extract the elevations of a selection set of 2d polylines?  I have a massive "contour" file composed of 2d polylines with elevations.  I need to find the min and max polyline elevation in selected areas.  I can't figure out how to extract just the elevations of my selected polylines so I can quickly see the elevation values?  Can anyone help me out or point me to a previous post that addresses this issue?  Thanks in advance.

AutoCAD Customization: Autodesk ObjectARX: How to load ARX dynamicaly by opening autocad at same time by Programatically

$
0
0

Can any one tell me how to load arx dynamicaly by start up autocad at same time.

Load ARX in startup and run the arx command after loading autocad.

Plz provide sample code if you have.

Thanks in advance

 

 

AutoCAD Customization: .NET: Transfering acad 2013 + vs2010 project to acad 2014 + vs2012 - debuging

$
0
0

Hallo,

 

I'm trying to move my project from VS2010 to VS2012. I can open project and I belive I can build a solution, but while trying to debug I get the information that It can not find destination element "C:\Program Files\Autodesk\AutoCAD 2013\acad.exe" and advice to set property OutputPath and AssemblyName.

 

Where can I find this properties? Is there any better way to transfer my project.

 

Thanks for your Advice!

W. Janik

 

 

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Replace multiple old xref file names with a set of new xref file names

$
0
0
Hi All,
I am looking for any assistance possible, as from the title i am looking at some kind of Lisp code that will change the X-Ref file name from 'x' to 'y' for multiple x-refs on multiple drawings.

I have found some information on Google that pointed to a thread back in 2010, instead of copying the code into this thread i have attached the link below

http://www.cadtutor.net/forum/archive/index.php/t-38673.html
I changed the code as recommended in the code text to reflect the old and new x-ref names and folder locations as instructed in RED:

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>
;>>>>> Enter all xref names below in this format >>>>>>
;>>>>> ("OldXrefName" . "NewXrefName") >>>>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>
("GL" . "EARTHSymbol")
("S" . "Shield")
("VERT4992" . "RS422")
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>

And

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>> XrefPathChange.lsp call out here. >>>>
;>>> Enter all xref paths to be changed in this format. >>>>
;>>> (xrefpathchange "c:\\Oldfolder\\oldfolder" "c:\\newfolder\\newfolder") >>>>
;>>> Note: Remove code if new xref path is unchanged. >>>>
;>>> Add ; infront of each line to block code. >>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
(xrefpathchange "Z:\\CADE\\SYM\\A" "S:\\AutoCAD Customisation\\Working")
(xrefpathchange "Z:\\CADE\\SYM\\A" "S:\\AutoCAD Customisation\\Working")
(xrefpathchange "Z:\\CADE\\SYM\\SONST" "S:\\AutoCAD Customisation\\Working")


i followed step by step how to load and run a LSP command at the startup, however when i inputed the code command xrefnamechange i got the following error message in the command box

Command: xrefnamechange
; error: Automation Error. File access error
Command:

As a beginner to all this i am going to take a stab in the dark and question the use of double \\ in the (xrefpathchange "Z:\\CADE\\SYM\\A" "S:\\AutoCAD Customisation\\Working") part of the code could this be the reason?

If you have any other sugestions or advice it would be greatly appreciated

Many Thanks

Simon

AutoCAD Customization: .NET: FDO - Map Checking-In / Checking-Out Features

$
0
0

Hello everybody !

My first post here ;)

Many thanks to everybody reading it ;)

 

Context :

  • AutoCAD Map 2013
  • Visual Studio 2010
  • .NET, C#, WPF
  • FDO
  • Oracle DataStore

Business Requirement :

The application manages some objects (features), containing business attributes and a geometry attribute (in an FDO meaning).
One of these business attributes should contain the length of the item drawn under AutoCAD Map.
If a user wants to modify the geometry of one of these items (by moving vertices for example), he must check out the feature of its choice (a polyline, or a point).

Then he can update the geometry of the feature, and finally, he has to check in the feature to store it permanently.

When checking-in the feature, I need to get the new length of the polyline (or new coordinates of a point for example), and I need to update the appropriate business attribute of the relevant object with the new length.

 

My technical implementation, not working :

I've handled the CommandEventHandler "CommandEnded" of  the Document Object (Autodesk.AutoCAD.ApplicationServices.Document). This event is raised when an AutoCAD Map Command has ended. In this handler, I test the GlobalCommandName of the Event Argument. I test "MAPCANCELCHECKOUT", "MAPCHECKOUT" and "MAPCHECKINALL".

  1. When MAPCHECKOUT has finished : I need to retrieve all of the objects that have been selected. I put each of them in a Dictionary, where the Key is the ObjectId (Autodesk.AutoCAD.DatabaseServices.ObjectId) and the Value is the relevant Business Object (in my own Application).
  2. When MAPCHECKINALL has finished : I need to browse all Checked-Out entries of my Dictionary. Using the ObjectId (the Key), I try to get the new Length of the Polyline (or Coordinates for a Point). and I need to get this value and update the relevant Business Object (the Value). But when I call transaction.GetObject(key, OpenMode.ForRead, true), it always throws an Exception of type "ePermanentlyErased". So, in other words, I'm unable to get the new Length of any checked-out Polyline (Object, Entity, Curve, etc...).

 

 

 

 

        void doc_CommandEnded(object sender, CommandEventArgs e)
        {
            Document doc = (Document)sender;
            Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
            switch (e.GlobalCommandName)
            {
                case "MAPCANCELCHECKOUT":
                    CancelCheckOut();
                    break;

                case "MAPCHECKOUT":
                    DoCheckOut();
                    break;

                case "MAPCHECKINALL":
                    DoCheckIn();
                    break;

                default:
                    break;
            }
            ed.WriteMessage("\nCommand ended : [" + e.GlobalCommandName + "]");
        }
        
        
        
        
                Dictionary<ObjectId, TakmGenericObject> __objectsIdToTakmGenericObjectsCheckedOut = new Dictionary<ObjectId, TakmGenericObject>();



        public void DoCheckOut()
        {
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
            PromptSelectionResult result = ed.GetSelection();
            SelectionSet selSet = result.Value;
            AcMapMap currentMap = AcMapMap.GetCurrentMap();
            MgLayerCollection layers = currentMap.GetLayers();

            Database db = doc.Database;

            using (Transaction acTrans = db.TransactionManager.StartTransaction())
            {

                foreach (SelectedObject selObj in selSet)
                {
                    // Check to make sure a valid SelectedObject object was returned
                    if (selObj != null)
                    {
                        // Open the selected object for write
                        SelectionSet selSet2 = SelectionSet.FromObjectIds(new ObjectId[1] { selObj.ObjectId });
                        AcMapSelection sel = (AcMapSelection)AcMapFeatureEntityService.GetSelection(selSet2);
                        foreach (MgLayerBase layer in layers)
                        {
                            Int32 iCount = sel.GetSelectedFeaturesCount(layer, layer.FeatureClassName);
                            if (iCount>0)
                            {
                                    // Getting Relevant Business Object
                                MgFeatureReader reader = sel.GetSelectedFeatures(layer, layer.FeatureClassName, false);
                                Collection<Object> ids = new Collection<Object>();
                                while (reader.ReadNext())
                                {
                                    Int64 id = reader.GetInt64("ID");
                                    ids.Add(id);
                                    ed.WriteMessage("\nID: " + id);
                                }
                                String shortName = (layer.FeatureClassName.Contains(':') ? layer.FeatureClassName.Substring(layer.FeatureClassName.IndexOf(':') + 1) : layer.Name);
                                TakmGenericObjectCollection<TakmGenericObject> goCollection = new TakmGenericObjectCollection<TakmGenericObject>();
                                goCollection.Descriptor = TakmGenericObjectDescriptorDictionary.Instance.GetFirstGenericObjectDescriptorByTableName(shortName);
                                if (goCollection.Descriptor != null)
                                {
                                    goCollection.SelectWherein("ID", ids);
                                    foreach (TakmGenericObject genericObject in goCollection)
                                    {
                                            // Putting Key-Value into Dictionary
                                            __objectsIdToTakmGenericObjectsCheckedOut.Add(selObj.ObjectId, genericObject);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        
        
        public void DoCheckIn()
        {
            Collection<ObjectId> unlocked = new Collection<ObjectId>();
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            using (Transaction acTrans = db.TransactionManager.StartTransaction())
            {
                foreach (KeyValuePair<ObjectId, TakmGenericObject> kvp in __objectsIdToTakmGenericObjectsCheckedOut)
                {
                    FeatureToDraw feature = new FeatureToDraw();
                    
                    try
                    {
                            //
                            //
                            //
                            
                        DBObject dbObj = acTrans.GetObject(kvp.Key, OpenMode.ForRead, true);
                        
                        // ---> this line always generate exception!
                        //
                        //
                        
                        
                        
                        Polyline pl = dbObj as Polyline;
                        if (pl != null)
                        {
                            feature.Length = pl.Length;
                        }
                        Curve crv = dbObj as Curve;
                        if (crv != null)
                        {
                            feature.Length = crv.GetDistanceAtParameter(crv.EndParam) - crv.GetDistanceAtParameter(crv.StartParam);
                        }

                        TakmGenericObject genericObject = kvp.Value;
                        if (genericObject.Descriptor != null)
                        {
                                // Updating Business attributes of Business Objects
                                // new length, new coordinates
                                // blablabla...
                        }
                    }
                    catch (System.Exception ex)
                    {
                        TakmLogger.Instance.LogError(__classFullName + "DoCheckIn", ex.Message);
                        if (ex.InnerException != null)
                        {
                            TakmLogger.Instance.LogError(__classFullName + "DoCheckIn", ex.InnerException.Message);
                        }
                    }
                }
            }
            foreach (ObjectId objId in unlocked)
            {
                __objectsIdToTakmGenericObjectsCheckedOut.Remove(objId);
            }
        }

 

 

 

Can someone help me please ?

Do I had made the good choice ?

Is there any best practice regarding my needs ?

Thank you very much.

 

tom.


AutoCAD Customization: Autodesk ObjectARX: Am having a tough time getting programming tutorials to work for ACAD

$
0
0

I am getting erros each time I ltry to oad the tutorial labs here:

http://adndevblog.typepad.com/autocad/2012/09/autocadnet-lesson-2-user-interaction-user-input.html

 

I have plenty of erros which make it impossible to compile or learn anythig about API.  Not sure why this happens.  I hope someone can shed some light.  Are these labs setup for .NET 4.0 or is that the problem?

 

Not sure what the purpose of these statements are, but they all have errors.

<Assembly: CommandClass(

or

<CommandMethod("

 

AutoCAD Customization: .NET: WCS UCS Point Transformations

$
0
0

I am using the following to transform coordinates

 

    Public Function TransformPointWCStoUCS(ByVal WCSPnt As Point3d) As Point3d
        Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
        Dim m As Matrix3d = ed.CurrentUserCoordinateSystem.Inverse()
        Return WCSPnt.TransformBy(m)
    End Function

    Public Function TransformPointUCStoWCS(ByVal UCSPnt As Point3d) As Point3d
        Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
        Dim m As Matrix3d = ed.CurrentUserCoordinateSystem
        Return UCSPnt.TransformBy(m)
    End Function

 

The WCS to UCS is returning a negative value for Y. Is there another version of these that I need to be using?

AutoCAD Customization: .NET: Am having a tough time getting programming tutorials to work for ACAD

AutoCAD Customization: .NET: send a plot script from a .net ObjectCRX plugin to accoreconsole to run?

$
0
0

Hi all,
We have a senario in which we want to first edit our DWG(through a plugin hosted in accoreconsole) file then plot it, we decided to plot with script rather than code (it is more clear and more documneted) so we first want to update dwg file(from .net code) and then based on loaded dwg file we will generate dynamically  a plot script to plot. and the question is how we can send our plot script to accoreconsole?
we tried  this
Application.DocumentManager.MdiActiveDocument.SendStringToExecute(plotScript,true,false,false);
but nothing happens

and the plot srcipt is 
FILEDIA

0

-PLOT
;Detailed plot configuration? [Yes/No] <No>:
No
;Enter a layout name or [?] <Model>:

;Enter a page setup name:

;Enter an output device name or [?] <None>:
DWG To PDF.pc3
;Enter file name <C:\Work\solids-Model.pdf>:

;Save changes to page setup? Or set shade plot quality? [Yes/No/Quality] <N>:
N
;Proceed with plot [Yes/No] <Y>:
Y
;Command:
FILEDIA
;;;Enter new value for FILEDIA <1>:
1


when we call this command in pluging hosted in AutoCAD (not accoreconsole) something wrong happens.
it seems this script is not working for this senario.
Thank you for your advice.

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Use of the Alt key in a macro

$
0
0

I use Spell Check regularly and I always check the entire drawing. I would like to add to the Spell macro so that when I pick Spell from the toolbar it goes past the Check Spelling window and begins checking the entire drawing. I believe I need to  insert Alt S into my macro to select Start from the window to begin the check. Is there a character or series of characters that will represent Alt in a macro?

 

Thank You

Viewing all 1680 articles
Browse latest View live


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