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

AutoCAD Customization: .NET: VB.NET SelectionFilter Twice

$
0
0

I would like to select all layers with a filter then check if the insertion point is the same on anyother layer without a filter. So i do 2 promptselectionResults. The first does great but the second fails with an error, assuming this means 0 items were found. my code snipet is below of my promptselectionresults in VB.NET

 

'' Create a TypedValue array to define the filter criteria
Dim acTypValAr(0) As TypedValue
acTypValAr.SetValue(New TypedValue(DxfCode.LayerName, "PLOH*"), 0)

'' Assign the filter criteria to a SelectionFilter object
Dim acSelFtr As SelectionFilter = New SelectionFilter(acTypValAr)

'' Request for objects to be selected in the drawing area
Dim acSSPrompt As PromptSelectionResult
acSSPrompt = acDocEd.SelectAll(acSelFtr)

'' If the prompt status is OK, objects were selected
If acSSPrompt.Status = PromptStatus.OK Then

. . .

 

 . . .


'' Select anything found at the sampe points
Dim acTypValAr2(0) As TypedValue
acTypValAr2.SetValue(New TypedValue(DxfCode.LayerName, "*"), 0)

'' Create a filter from type value
Dim acSelFtr2 As SelectionFilter = New SelectionFilter(acTypValAr2)

'' Get all objects in cross window using filter and select anything at the same point
Dim acSSPrompt2 As PromptSelectionResult
acSSPrompt2 = acDocEd.SelectCrossingWindow(p1, p2, acSelFtr2)

'' Check if prompt is good and items were found
If acSSPrompt2.Status = PromptStatus.OK Then


AutoCAD Customization: .NET: Attribute alignment never updates

$
0
0

In Autocad I'm programmatically settign the alignment of an attribute to MiddleCenter.  Looking at the attribute I can see that the alignment is set properly.  However, the alignment does visually update itself.  

 

I'm able to manually update the allignment if I open the Enhanced Attribute Editor and make any change.  If any property is updated, the attribute "realizes" it needs to update the alignment.

 

How can I make AutoCAD automatically update the alignment?  Here is a current snippet of my code.  In this particular instance "result" will contain 004 as a string:

 

attribute.TextString = result 

attribute.Alignment = AcAlignment.acAlignmentMiddleCenter
attribute.Update()

AutoCAD Customization: Autodesk ObjectARX: Transparency not working in 64 bit

$
0
0

Hi,

 

The following code is an example of how I am calling transparency on a custom entity.

 

For some reason it works in 32 bit but not in 64 bit autocad.

 

Any ideas?

 

double setTransAlpha = 40;

 

AcCmTransparency trans(setTransAlpha);

 

trans.setMethod(AcCmTransparency::transparencyMethod::kByAlpha);

 

if(transparency == 0)
   {
       setTransAlpha = 255;
}
else
setTransAlpha = 255 - ((255.0/100.0) * transparency);

 

trans.setAlpha(setTransAlpha);


mode->subEntityTraits().setTransparency(trans);

AutoCAD Customization: .NET: Unitless Block Insertion

$
0
0

HI All,

If you insert a Unitless block into a drawing with the units set to mm or inches via the interface, AutoCAD will automatically take care of the scaling for you. By looking at the properties of a Unitless block after insertion it appears as though all CAD is doing is scaling the block in accordance with the units in the drawing.

 

Does anyone know how CAD is doing this calculation and how to get the same effect using the .NET API at the time of insertion?

 

I could setup a function that examines the units of the block being inserted and the units of the drawing the block is being inserted into but how would i be sure i'm using the same conversion value as CAD?

 

e.g. I might decide 1 Unit = 0.0393 when i do the insert, whereas CAD might use 1 Unit = 0.03937007.

 

It would be nice to either use the same value or a function that the API provides that i'm not aware of to do the conversion

Any help would be great.

Thanks

AutoCAD Customization: .NET: Lock Document

$
0
0

I am using AutoCAD 2014 and vb.net 2010 and coverting code from 2010 to 2014.

 

This like does not work anymore.

 

Using locked As Autodesk.AutoCAD.ApplicationServices.DocumentLock = ThisDrawing.LockDocument()

 

Any clue as to why?

 

These are the lines for ThisDrawing

 

Public ReadOnlyProperty ThisDrawing() AsDocument

       

Get

           

ReturnApplication.DocumentManager.MdiActiveDocument.GetAcadDocument()

       

EndGet

   

EndProperty

AutoCAD Customization: .NET: how to drawing a line tangent to two circles in C#?

$
0
0

 how to drawing a line tangent to two circles in C#?

 

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Sheet List Table + Issue Dates

$
0
0

Hello,

I'm new to the Project Manager, I've set up a few jobs using this tool, all drawing information is set up as fields and edited via Project. I can now generate the Drawing List automatically which is pretty sweet, but I want to be able to include the issue dates (I've created custom fields for them) in my Sheet List Table. I sort of can now, but it's not looking too good.

I came across a how to on the interwebz but managed to lose it :smileyfrustrated: anyone know how to convert my issue date info from this:

drawing list before.png

To something more like this:

drawing list after.png


Right now the Issue information is just lines and text i matched up to the table...

AutoCAD Customization: .NET: How to Customize top level UI to Ribbons using VB.NET for AUTOCAD 2014

$
0
0

Hi, I want to create plug-in that customize most top useful UI, menu command or options to the Ribbon for the Autocad 2014 using vb.net 2010/12


AutoCAD Customization: .NET: How AutoCAD Set folder in options during statup?

$
0
0

Hi my query is:

 

The list of folders for network drives or local will be part of configuration XML. User should just modify the XML and AutoCAD would set the folders in options during startup. The XML would contain data for different profiles

AutoCAD Customization: .NET: Obfuscator and my acad plugin dll app

$
0
0

Not sure if anyone can help if they don't have this software, but am going to try.  Maybe someone knows.

I use logic NP obfuscator and am trying to compile a dll plugin I am wanting to send on the app portathon, so I need an answer as soon as possible if anyone can share some insight.

 

 

Obviously there is some obfuscating in the acad support files, that I guess mine is bucking with.  This is the error message I am getting.  I tried to ignore the acad stuff.

 

Crypto Obfuscator For .Net v2013 R2 Standard (Licensed To: James Boone,Powersoft Engineering), Build:130904

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

Running from UI - C:\Program Files (x86)\LogicNP Software\Crypto Obfuscator For .Net 2013 R2\CryptoObfuscator.exe

Obfuscator Project File= A:\_EPS folder\PanSchPro acad\bin\EPSElec.obproj

Output Path= A:\_EPS folder\PanSchPro acad\bin\Obfuscator

Loading assembly 'A:\_EPS folder\PanSchPro acad\bin\EPSElec.dll'

Preparing assembly 'EPSElec'

 

Error occurred while obfuscation: System.IO.FileNotFoundException - System.IO.FileNotFoundException: Could not resolve: Acdbmgd, Version=19.1.0.0, Culture=neutral, PublicKeyToken=null. Specify the path where this assembly resides using 'Search Directories' in the Crypto Obfuscator's Project Properties Dialog (Ctrl+P).

   at A.cb24b5c995a4b3c86147a8d69d9719630.c321f3c9128e424f37bb880e068efff85(c321a25747e1f498390774b65fb9f89af ) in File203:line 108

   at A.c2224c862d1a97307eaa6744d9fd44052.c321f3c9128e424f37bb880e068efff85(c321a25747e1f498390774b65fb9f89af ) in File215:line 71

   at A.c535ae534c1db2c6fa21d03d4b8fe97f6.c321f3c9128e424f37bb880e068efff85(c20ba0ba68fd6b425e71a765705a50574 ) in File182:line 79

   at A.c20ba0ba68fd6b425e71a765705a50574.c321f3c9128e424f37bb880e068efff85() in File2:line 201

   at A.c1a5e0c07abbeebee260c9294e9ffb443.cb3258476904695ff17ea41cfa007be2a(c20ba0ba68fd6b425e71a765705a50574 ) in File270:line 1143

   at A.c7ef3407ce7699a98d477921a4f307e97.c0216acd28360b854616e69342e43c906(c1a5e0c07abbeebee260c9294e9ffb443 , List`1 , Hashtable , c345a8b484323503b63d6257e9c79f632 ) in File270:line 1009

   at A.c7ef3407ce7699a98d477921a4f307e97.c7c3e4ecccb6e8d96390def8e3e3f5e5a() in File270:line 866

   at A.cfa31229d37496446ccf88f83596adf9d.c06aad533d46c5d74d67d9ee472ea5b01() in File314:line 1258

   at A.cfa31229d37496446ccf88f83596adf9d.ca4838fb9343869ab96585d35476ae1ae(c4c650b0a5c7749985595b3e1ea6e3255 ) in File314:line 2548

 

AutoCAD Customization: .NET: CommandMethod executes command only once ?

$
0
0

I am having a very interesting problem with my code. When I run my code the first time CommandMethod works and executes without any problems, When I try to run it again I get : Unknown command. I have to reopen AutoCAD in order to run the command again.

 

Has anyone experience this problem before.

AutoCAD Customization: .NET: Isit possible to leave elements in selection mode, after a selection action?

$
0
0

Hello,

When creating a selection Command using the PromptXXXOptions and PromptXXXResult. The entities are selected on the current view, but once the selection ends the entities return to an unselected state.

Is it posible to leave them in selection mode.

 

I want to this, beacuse it will be better to use Editor.SelectImplied() instead of saving the last selection object Ids.

 

Thanks

AutoCAD Customization: Autodesk ObjectARX: ObjectArx 2012, Add Variable Wizard error

$
0
0

Hi all,

 

In ObjectArx 2012 project, I try to add a variable with the Add Variable wizard in VS 2010. But it fails and i get a error message. And the Control variable type combobox is disabled.

 

Please help me to solve this problem..!!thanks in advance..!!

AutoCAD Customization: Autodesk ObjectARX: ObjectArx 2012, 2014. Add Variable Wizard error

$
0
0

Hi all,

 

In ObjectArx 2012 project, I try to add a variable with the Add Variable wizard in VS 2010. But it fails and i get a error message. And the Control variable type combobox is disabled.

 

in ObjectArx 2014 project - VS 2012. Add Variable wizard, the Control variable type combobox don't no longer include the types as AcGePoint3d,...

 

Please help me to solve this problem..!!thanks in advance..!!

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: to use ordinary commands in blocks without block edits

$
0
0

hi ,

 

i like to work with block system in my project , but i dont like to use block editor or refedit for every action inside my block  ...i found some lisps for  add or remove objects from blocks but not enough for dont use to block editors ,  i need to lisp for use ordinary command for blocks without get them inside if ther is possibility ...

 

would be nice to share with us if somebody has the similar lisp 

 

 


AutoCAD Customization: Visual Basic Customization: VBA codes work with AutoCAD 2012, but not AutoCAD 2014?

$
0
0

Hi everbody,

 

My problem is that I did my project with AutoCAD 2012 also used VBA.  It work so good with 32 bit AutoCAD 2012.

 

However, when l try different computer Autocad 2014 64 bit, same codes also I downloaded everthing. (VBA 2014 64 bit).  it doesn't work.

 

I put picture on attachment.

 

Can somebody give me any tip?

 

Thanks...

 

 

AutoCAD Customization: .NET: Reg. Add Menu in the Main Menu bar like File Edit etc

$
0
0

Hi,

 

I want to add the menu in the main menubar where the File Edit etc. are there.

 

Can anyone tell me how to do this using .NET ?

AutoCAD Customization: .NET: Erase stand alone objects in dwg

$
0
0

I would like to remove all the Layers with the name "PLOH*" in them, that do not have anything in the same insertion point. I have been trying to select everything in the crossing window where the point3d's are the same but this does not get them all for some reason. how would someone else do this. I have attached a dwg.

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Extract Linetype From DWG File?

$
0
0

I've got a linetype that's part of our autocad template file and has been for so long that nobody around here even knows where the original lin file is.

 

I need to extract the linetype out so that I can make some minor modifications.  I did do a search and found a nifty lsp routine from Paul Turvill.  (Here's the thread that pointed me there:  http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Extracting-Linetypes/m-p/1037624/highlight/true#M150152).

 

I ran it and it SEEMED to work.  All the linetypes in the file it created look good EXCEPT for the one I needed to extract.

 

That one looks like this in the lin file:

 
*TREELINE,Series of arcs used to indicate tree drip lines
A,0.0001,-0.0001,

 

The linetype DOES display properly in the dwg file (meaning lines drawn using it look good).

 

Any ideas/suggestions?

 

TIA!

AutoCAD Customization: Visual LISP, AutoLISP and General Customization: Convert all Attributes to Layer 0 using LISP

$
0
0

I have searched the web and the Autodesk Discussion Group for a LISP Routine that allows me to convert all attributes in a drawing to Layer 0 but i have had no luck. Please Help. It would be great if the LISP could edit xrefs as well although not sure if this is possible.

 

**BATTMAN command will take too long for the hundreds of blocks, xrefs and drawings i need to edit.

 

Thanks.

Viewing all 1680 articles
Browse latest View live


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