AutoCAD .NET :: Passing A Structure To A Sub
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
ADVERTISEMENT
Nov 4, 2011
We use C3D 2012 (metric only) - We are attempting to customize our list of structures for Sanitary Sewers. The structure list shows sizes we do not use and we would like to modify them. However, when we try to select the "Inner Diameter" it displays a list of sizes that we can not seem to modify or add to.
I have looked at some of the XML files to try and modify or add new sizes (example: AeccStructConcentricCylinder_Metric.xml) , but they do not seem to be recognized even after I restart the program.
Here is what the file looks like:
<ColumnConstList desc="Inner Structure Diameter" dataType="float" unit="mm" name="SID" id="CCL1" visible="1" context="StructInnerDiameter" index="0">
<Item id="i0">1200.0000</Item>
<Item id="i1">1350.0000</Item>
<Item id="i2">1500.0000</Item>
<Item id="i3">1800.0000</Item>
<Item id="i4">2050.0000</Item>
<Item id="i5">2300.0000</Item>
<Item id="i6">2550.0000</Item>
I tried modifying the last line replacing 2550 with 3600.
I also tried adding a line <Item id="i7">3600.0000</Item>
I saved the XML file and restarted the program with nothing changing that I can see.
Looking for correct file(s) to edit so I can modify the LISTS that come up in the piping modules.
View 2 Replies
View Related
Feb 12, 2008
One good thing about null structures is the way they display in 3D. They cover that gap in the pipe segments. Can I steal that shape?
I am currently using a simple cylinder for water pipe "joints" and turning it off like most people do I think.
View 4 Replies
View Related
Apr 30, 2012
I have drawn a pipe network with multiple concentric sturctures. I need to make them all eccentric now. Is there an easy quick way to do this, or do I have to redraw all of them. When I go to the properties, I cannot find an option that allows me to change this.
View 2 Replies
View Related
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
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
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
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
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
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
Jul 25, 2012
The good news is that, if I were righting a routine that locks up AutoCAD, I'm finished. The bad news is that I'm not.
The code below is the portion of a routine where I have the user select 2 points and then pass those points to the Zoom command and the M2P osnap. The problem is that, when the Mid Between 2 Points osnap tries to use the first point, it returnns an "Invalid point" message, enters a loop and locks ACAD.
(defun C:ZC ()
(setq PointOne (getpoint "First point of M2P "))
(setq PointTwo (getpoint "Second point of M2P "))
[Code].....
View 2 Replies
View Related
Feb 29, 2012
I'm trying to complete the code to select a p-line on layer G-POLY-GSF w/o asking for input. this (setq ent (ssget "X" (list (cons 8 "G-POLY-GSF"))) dosen't seem to work. What I'm I missing here?
(defun cf8 (/ ent dist obj)
(vl-load-com)
(setq ent (car (entsel "
Select line to offset: "))
;(setq ent (ssget "X" (list (cons 8 "G-POLY-GSF")))
[Code]....
View 8 Replies
View Related
Oct 23, 2012
How can I pass the contents of a cell value (text string) to Acad? I want the user to click on a cell, then have lisp use the string as the name of a block to insert.
View 4 Replies
View Related
Sep 16, 2013
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?
View 9 Replies
View Related
Oct 23, 2011
using zoom wheel on mouse, how do i enable passing through walls, instead of continuing to zoom further and further in on walls
View 1 Replies
View Related
Aug 30, 2011
I am having a problem with copying a transparent layer and then Pasting it from the clipBoard to any graphic program (irfanview and WebPlusX4).
The Transparent layer contains a cloudBrush graphic. The foreground color is white, and bg color is black.
When I paste it into webPlus, it shows up as ALL white. Then I change the pasted image as Transparent with white a bg. The ALL white disappears. And so does the cloud image.
How come I can't see the image? What must I do in Gimp to be able to pass the imageLayer via clipBoard.
View 1 Replies
View Related
Jan 9, 2013
I now understand about serializing the message, and loading and running external scripts via opening, reading, and sending them within the context of BridgeTalk.
I have a palette window which contains a listbox of items that searches and lists the contents of over 400 products. This pic of the template below is typical for all items. The imprint area shown will change depending on the product.
Script #1:
When the user selects a product from the list, that selection is used to open a file (illustrator template) for that item that shows a guide path box with height and width information for the imprint area on the product. The currently opened illustrator document contains the artwork they are working on at the time. This artwork is copied and pasted to the newly opened template file.
Script #2:
This script contains an array of all the products in the palette list. Within each index of that array, each item will contain the following information:
Example (the name property of each item will match the name of the index box selection from script #1):
var itemArray = new Array();
//p may be saved at index 0 of itemArray
var p = new Object();
p.name ="P- Shape P";
p.width = 189;
p.height = 103.5;
p.pos = [300,564];
I need to send the selection from script #1 to script #2 so I can loop through the array and find a match, at which point the information stored in the properties of the item will be used to scale the art and place it in the correct position on the template. Is there any way to send a variable from script #1 containing the name of the selection via BridgeTalk and have it stored in a variable in script #2? If not, I read somewhere where it might be possible to write/save it to disk and have the second script read it.
View 8 Replies
View Related
Nov 30, 2012
i am building a bowling alley for a university assignment and have 10 pins being knocked over by a ball, with a wall behind them. then animation works and they are all get knocked over, but the pins go through the wall and i want them to bounce back of it, and keep them inside the scene environment i have created..
View 1 Replies
View Related
Jun 24, 2013
I have a symbol on the stage: symbol1.Inside symbol1 I have an image: symbol1_image1...I have another symbol on the stage: symbol2 Inside symbol2 I have an image: symbol2_image2
in composition.ready I have an action on the mouseout for symbol1:
var theTarget = sym.getComposition().getStage().getSymbol('symbol2').$('symbol2_image2');
sym.getComposition().getStage().doMouseoutGS(theTarget);
In composition.ready i have the following function defined
sym.doMouseout = function (colorTile){
sym.$(colorTile.show());
}
I cannot get this to work and I am not understanding why.If I do an alert on the mouseout function for alert($(colorTile).attr("id")); I get the correct referenc to the element I want to show but it does not actually happen
View 6 Replies
View Related
Dec 1, 2013
I need to use the dimension created by an action-parameter as a variable in a user defined function but AutoCAD will not allow me (see attached).
How may I access the action-parameter's dimension ?
View 1 Replies
View Related
Sep 7, 2011
how to draw the intersection wire like a half circle passing over the other wire.
View 9 Replies
View Related
Jul 13, 2013
How to make a new work plane rotated at an angle to another plane and passing through the axis of a cylinder, or one of the main axes.On the plane commands, in V2013, i don't find an option for plane at an angle
View 1 Replies
View Related
Mar 25, 2013
Curser is dragging across the image and distorting even when not clicking on it. is the proxy image in the dialog box adjustable? the resolution is to hight. I have 16G of ram so thats not the problem. (it works ok on smaller low res images)
View 9 Replies
View Related
Nov 13, 2012
I'm trying to be able to have a function run another function with the secondary function being passed as an argument to the first. I'm trying to create a recursive function and the recursive part works great. I just need to be able to have the recursive function run other functions to actually do stuff.
Here is something I found that should do what I need, mainly run a function from a function name in a variable.
Sub test() Dim ftnName As String Dim argument As String Dim result As String ftnName = "myFunction" argument = "cat" result = Application.Run(ftnName, argument) MsgBox resultEnd SubFunction myFunction(inString As String) As String myFunction = inString & " has " & Len(inString) & " letters."End Function
However I get the error "object required" on the "result = Application.Run(ftnName, argument)" line. So I'm guessing the Inventor VBA doesn't like this method of doing this. I'm just hoping there is a way to do this or this function will be useless or reduced to hardcoding functions which still defeats the purpose.
View 2 Replies
View Related
Sep 28, 2009
How do I change the BOM structure of iParts from Normal to Purchased? The BOM editor in the assemblies that use the iParts have the iParts as read only. I can't find a way to change them to purchased from inside the iPart either.
View 3 Replies
View Related
Oct 20, 2011
I've copied over some hardware from the CC to our custom library... washers and bolts. How can I change the BOM structure of the parts to Phantom, I really don't want them showing up in parts lists... and I'd prefer not to just shut off the visibility at that level. They are all set to "Purchased"... can this be changed? I tried opening the part and setting the default to Phantom, but since it is a CC part, I get an error message.
View 3 Replies
View Related
Jul 26, 2012
Let's say i want to draw a bike. In the 2D IDW of the wheel I want to see the frame as a reference. So, in the .iam of the wheel the frame subassembly is inserted and checked as reference. Also, a new level of detail is created that surpressed the frame.This level of detail is used in the overall assembly of the bike.
So, I end up with several subassembly's that contain other subassembly's just to reference them in the IDW. It would be better to have just one master assembly and create several IDW's from that assembly with different LOD and reference settings.
Inventor 2012 - 64 bit - build190 - Windows 7
View 4 Replies
View Related