AutoCAD .NET :: Passing Late-bound Variant Arrays
Aug 22, 2012
I have been attempting to pass a string array contained in a variant to the AutoCAD method AcadPlot.SetLayoutsToPlot. I am using late binding without a Interop assembly because we have several versions of AutoCAD in this company and I would like to support all of them from the same code base.The method wants a variant that contains a string array passed byref. The Microsoft documentation on COM interop from VB.NET makes it sound like the compiler will marshal it correctly by default, but it always throws a COMException (Exception from HRESULT: 0x80070057 (E_INVALIDARG)).
The stack trace shows it is trying to anyway:
StackTrace:
at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
But no matter how I code it I cannot get this variant array passed to AutoCAD.I have tried:
Imports System.Runtime.InteropServices
' VB default marshalling
Dim layoutarr = New Object() {"Layout1"}
doc.Plot.SetLayoutsToPlot(layoutarr)
' using a VariantWrapper
Dim layoutarr = New Object() {"Layout1"}
Dim wrapper As New System.Runtime.InteropServices.VariantWrapper(layoutarr)
doc.Plot.SetLayoutsToPlot(wrapper)
[code]...
As intensively as AutoCAD ActiveX uses variant arrays, I know this problem is going to come up again and again for me as I try to migrate code over to .NET.
View 5 Replies
ADVERTISEMENT
Jul 14, 2012
I'm working on a small design project and creating a program in Inventor that utilizes a 2D Sketch to calculate the forces in a 2D static Bridge.... Although this is Besides the point.
In order to do what I want, I've found it will be easier to use Arrays. Unfortunately I'm having trouble passing arrays through various functions and setting them to each other.
These errors are constantly popping up
Rule Compile Errors in Bridge Stress, in Sketch Test Code.ipt
Error on Line 60 : Number of indices is less than the number of dimensions of the indexed array.
Error on Line 63 : Number of indices is less than the number of dimensions of the indexed array.
Error on Line 69 : Number of indices is less than the number of dimensions of the indexed array.
Error on Line 174 : Number of indices is less than the number of dimensions of the indexed array.
Error on Line 308 : Number of indices is less than the number of dimensions of the indexed array.
Attached you'll find the code I'm using.
View 1 Replies
View Related
Apr 5, 2012
We developed a 32-bit .cpg plugin a couple of years ago to allow CorelDRAW to interface with our (32-bit) graphics program by providing a custom button on the CorelDRAW toolbar.The CPG plugin works fine in CorelDRAW X6 32-bit but not in the 64-bit variant.Is 64-bit CorelDRAW going to support existing (32-bit) CPG's?Or will we need to rebuild new CPG's using a new SDK?If a new SDK is required, when will that be released?
Test computer configuration:- Windows 7 64-bit
P.S. I attempted to submit this question through the Corel "Ask a question" web page but it appears that page is not working correctly. After submit, both a success message and an error appear on the resulting web page. There is no reason given for the error.
View 8 Replies
View Related
Nov 20, 2013
my client have a Mac Mini with 512Mb of Vram. He try to use the 3d features of photoshop cs6, but he cant because the menu is gray. The accelaration is In the Edit/Perferences/Performance menu is "ON".
The integrated video card of the Mac Mini is Intel HD 4000, it is strong enough to use the 3d "services" of Photoshop.
View 3 Replies
View Related
Sep 1, 2009
Program: Civil3D 2010
Upon binding my dwgs to send to clients, sometimes I run across a serious problem. My xref'ed site plans disappear but my xref manager still lists it as attached, the layer manager still has every xrefed layer, and all other xrefs in the dwg will bind perfectly.
I have broken down all complex objects, purged, audited, cleaned up any excess scales, and even created new fresh dwgs for the xref and the drawing in question; all actions have ended in failure. I have even searched the AutoDesk forums for a solution and have found nothing substantial.
Solution: #1 Use RECOVERALL command on .dwg file that the xrefs disappear from. It will remove all proxy objects and excess scales in the file that is causing it to disappear in the first place.
#2 WBLOCK out the dwg file and any xrefs that are disappearing and insert them into new "clean" .dwg files. Must be done to all files.
View 9 Replies
View Related
Aug 24, 2011
When i bring a model in layout using chspace and ls it for its co-ordinates, it gives me upper bound and lower bound coordinates.What exactly is upper bound and lower bound coordinates?
View 0 Replies
View Related
Jul 30, 2013
I'm a document controller that is trying to ID the situation with 2600 drawings. Some files are so large - 250,000kb, they won't open. They have bound xref's in them. We want to ask the contractor to unbind them and attach them as normal xref's. I need to view if a drawing has bound xref's. I just want to see them as BLOCKS which I now understand they are. How do I do view the blocks that were once xref's?
View 9 Replies
View Related
Jun 4, 2013
Is there a way.....
I have a drawing that has external references bound to it. I would like to extract the bound external reference to its own drawing. Can this be done?
View 8 Replies
View Related
Aug 6, 2012
I am currently looking into mirroring and arrays and i wondered if it is possible to have some kind of adaptive mirroring activated or used.
The aim is as i change the instance which is arrayed or mirrored i want the objects in the array and the mirrored parts changed too.
If it is´not possible just like that i would want to do a macro or i logic form that updates the array or mirror to have matching parts again.
View 4 Replies
View Related
Jul 23, 2013
Civil 3D 2014.I want to attach attribute information and/or metadata to my array. Is this possible?
If it is possible, I would also like to be able to explode my array and have my array items acquire the attribute information for exporting later. Can this be done as well?
View 1 Replies
View Related
Aug 9, 2012
I'm wondering how to create huge arrays in the best way. I have a circle and want it thousands of columns and tens of thousands of rows. Anytime I start to make this AutoCAD gets extremely slow and I was told that turning some into blocks would be best.
View 2 Replies
View Related
Jun 10, 2013
I am currently drawing a lithography mask in Autocad 2013 student version, where I created a lot of arrays. My problem is that I can't seem to align these structures. Some of them need to be aligned along the y-axis and some along the x-axis.
View 5 Replies
View Related
Apr 8, 2011
I've been trying to figure out if chaining parameters will accomplish what i'm trying to do, which is...
Imagine an elevation of a concrete pier or column showing the horizontal stirrup cage around the vertical reinforcement. If like to be able to use one parameter to control the space between elements (cage c/c) and another to control the total length of the array (height of column or # of cages). Then the actual number of elements would be total length/spacing.
Also, arrays alway seem to have fixed spacing, anyway to make the parameter control the spacing of the array?
View 7 Replies
View Related
May 23, 2012
Is there a way to declare a non-bound array (dynamic array?) in iLogic?
There are examples of set bounds array:
MyDoubleValues = New Double(){1.2,2.2,3.3}
But doing something like:
Dim MyDoubleValues() As Double ---Or--- MyDoubleValues = New Double()
Results in an error. On the other hand, the following totally works:
Dim MyDoubleValues(1) As Double
Which creates an array with a Ubound of 2
View 1 Replies
View Related
Jul 24, 2012
I am into tracking solar array's. So designing for high winds is paramount. I wonder if Inventor will have a package for analysis of wind loads. It is a different kind of FEA. Call it a 3-D distributed load.
View 5 Replies
View Related
Aug 8, 2012
I am trying to make a huge array of circles (4000 x 12000 or so). I work in microfabrication and need this to make a mask for lithography of a membrane. What is the best practice to minimize the memory usage? I.e. arrays, blocks, groups? I tried making an array of circles one row and 4000 columns then making that a block. Then repeating that block down for multiple rows, maybe 100, then making that a block. Repeating this until I have thousands of them. Is this the best way? It bogs down and gets incredible slow which I am hoping to avoid. I realize that it is inevitable that it will get slow with these huge numbers.
View 1 Replies
View Related
May 24, 2013
I have a need to save coordinates points for a couple of objects, so I decided to use a structure object.
Here is my structure for an 8 sided polygon:
Structure OctoPolygon Public Shared pt1 As New Geometry.Point3d Public Shared pt2 As New Geometry.Point3d Public Shared pt3 As New Geometry.Point3d Public Shared pt4 As New Geometry.Point3d Public Shared pt5 As New Geometry.Point3d Public Shared pt6 As New Geometry.Point3d Public Shared pt7 As New Geometry.Point3d Public Shared pt8 As New Geometry.Point3d Public Sub setPoints(ByVal drawingStartPoint As Double, ByVal mcSize As Double, ByVal mcCenter2Cham As Double)
[code]....
It says "Access of shared member, constant member, enum member, or nested type through an instance; qualifying expression wil not be evaluated"
how I can get the sub to see the points defined in the structure?
View 5 Replies
View Related
Jan 4, 2008
I am trying to create a block that polar arrays the street lamp, but every time i try i just move the grip for it, is there something i am missing?
View 8 Replies
View Related
May 6, 2012
In Photoshop CS6, the moment you select the Crop Tool, a "cropping bounding box" appears instantly over the image. This didn't happen in CS5. In CS5 I would be able to click and start dragging the Crop Tool 'outside' the image and then drag into it so that my "cropping bounding box" (don't know what to call it) would snap to the edges of the image.
In CS6, since this box is automatically there already over the entire image, clicking outside the image invokes some unwanted rotation action.
View 3 Replies
View Related
Sep 28, 2012
is there a way to turn Show Selection Bound Handles off until you need it (beyond continuously toggling it off). Using Pro 5
View 6 Replies
View Related
Nov 20, 2012
I got a problem to pass parameter from VB to batch file. My code is below to run the batch file and to pass parameter.
Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
Dim input As String
Dim output AsString
input = "C:atchFile est.gds"
output ="C:atchFile est.dxf"
Dim batchFile As String = "C:atchFileLC_gds2dxf.bat"
Process.Start(batchFile, input & ""& output)
EndSub
With this code the output is like below:
If you look at the screen shot you can find out that input and output variable is passing to one variable LC_gdsin. But I want that output file location will be assigned to LC_dxfout. I tried a lot but could not able to do that.
I am using VB2010 premium and windows 7 32 bit pc
View 2 Replies
View Related
Jun 30, 2004
I have a master layout (ipt), from which I've created derived parts, that get put together in an assembly. I'm able to pass parameters from my master part to the derived parts, but I don't seem to be able to pass parameters from the derived parts to the assembly. Is this possible?
View 9 Replies
View Related
Oct 18, 2011
I recently added the QR Code plugin from the labs to ACAD 2012.
[URL]
It's pretty cool, and I have added it to one of my title blocks so that contractors can access more resources via their phones if they have questions on site. The code can be updated with a simple command QRED.
The downside of this, of course, is that I have to edit my block for every project. The documentation says that the encoded info is stored as XData. Is there a way to access this data via a field, or pass a variable/attribute through to the plugin to male this a bit easier?
View 0 Replies
View Related
Mar 11, 2013
I've created a script and bound it to an icon, then added the icon to the standard toolbar.
Everything works, but the script will (correctly) give an error message if it's run when no image is open.
The bound icon on the toolbar is always enabled, even if no image is open. Is there a way to have the icon disabled (grayed out) if no image is open?
View 4 Replies
View Related
Feb 7, 2013
Is there any way to bind multiple keystrokes to one function--like say I want slide back to be both D-Left and "," , is there any way to set this up?
View 1 Replies
View Related
Feb 10, 2011
I'm trying to create a .DLL to access a database from within iLogic. I'm new to VB.net so I'm having some trouble. I need to pass a multidimensional array as an argument to the DLL, but when I try to run the code I get an error that says "Number of indices exceeds the number of dimensions of the indexed array."
Here is my code..
The errors occur on the sData(0,i) and the sData(1,i)
I left all the database code off, because passing the array is the big issue I believe.
Public sub AddRecord(ByRef sData() As String)
For i = 0 to FieldQty
rst.Fields.Item(sData(0,i).Value = sData(1,i)
Next
End Sub
View 5 Replies
View Related
Dec 11, 2012
How do you save features added in an assembly to the part? For example, if I add a hole in an assembly, presently I cannot see it when I open the part. It seems like a very basic function, I'm not sure why it doesn't do it automatically.
View 6 Replies
View Related
Jul 9, 2013
I would like to use a string as a variable if this is possible. I've got:
new-pl-lay (as a variable that holds layer name "UGL_PL_NEW")
first-cable (as a string that holds "new-pl-lay")
I'd like set the current layer to "UGL_PL_NEW" by using the first-cable string.
Something like:
(command "_.layer" "m" (read first-cable) "")
View 8 Replies
View Related
Feb 14, 2011
I have 2 points and a line given (both points on one side of line)
I want to draw a circle so that it passes through two points and tangent to the given line.
View 9 Replies
View Related
Jul 30, 2013
I'm working on a script with an UI element. I want all values of the 2. cloumn (Rasterkeilfarbe) returned in one array and all values of the 3. column (Klischeenr.) returned in another arry.
var farben = ["black", "red", "blue", "green", "bla", "blupp"]
var myName = myInput (farben);
// rest of the script
[Code]....
View 5 Replies
View Related
Aug 14, 2012
Writing a routine that stores a file name as a string in variable FILE.I check the variable and it returns a nice quoted string: "filename-123.dwg"
I would like AutoCAD to open the file w/out user input.With FILEDIA set to 0, I've tried passing the variable to the command line:
(command "open" FILE)
or in a script as:
open
(FILE)
...
or,
open
!FILE
...
I get the same error. The string dumps to the command line and I get 'Unknown command "DWG" .'
View 9 Replies
View Related