Ok, let me simplify my explanation of what's going on. I get "Object variable or With block variable not set" when trying to execute the following that refers to the active document. I’ve also gotten the error, which is related, “object reference not set to an instance of an object.”
Dim oAsmCompDef As Inventor.Assemb lyComponentDefi nition
oAsmCompDef = ThisApplication .ActiveDocument .ComponentDefin ition
...
User Profile
Collapse
-
hollertrek started a topic Insert 1 Document Into Another Document - A part into an assembly drawingin .NETInsert 1 Document Into Another Document - A part into an assembly drawing
I know this code references Autodesk Inventor (CAD) API, but I'm hoping for a generic solution to my problem with the following error. The error is "object reference not set to an instance of an object" and the macro takes an open document (part file drawing) and inserts it into another open document (assembly file).
Code:
...Code:' Set a reference to the assembly component definintion. ' This assumes -
-
Now it's starting to make some sense. You guys are good. :-) Thanks!Leave a comment:
-
Would you elaborate? I know the .net framework allows the use of other languages in vb.net, but I'm clueless where to start. Unless that's not where you're going with this. And that still doesn't answer if I would use it in a function, etc. I'll read up on it....Leave a comment:
-
I don't mean to be a twit here, but could you explain the syntax? I'm not familiar with the string[] filenames portion. Is this symbolic or actual code? In what context would I use it, in a function?Leave a comment:
-
I have a file naming convention that looks like this:
jholler_001.ipt
I'm trying to create a collection from a directory of all files with the form that will have different _000s. For example, jholler_012, jholler_022, jholler_102.
How would I use Regex, create a statement that does this?...Leave a comment:
-
Ok, so this looks more like a different class (sql statements rather than simple strings) that's used in asp.net more so, rather than straight vb.net? I'll have to digest this because I'm unfamiliar. But you're saying string manipulation doesn't allow what I'm asking? Thanks.Leave a comment:
-
Wildcard in a String Concatenating
I'm evaluating a string (below) in a function.
Is there a way to add 3 characters to this string that are unknown type, a wildcard in a sense?Code:Return CBool(filename.StartsWith(ValueJon & "_"))
Thanks,Code:Return CBool(filename.StartsWith(ValueJon & "_" & "XXX"))
J -
I'll try these tomorrow. This is a very efficient user group. Thanks for the good answers.
JonLeave a comment:
-
Does Any File Exist in a Directory - Boolean
This was recently posted as a way of finding a file. If I wanted to know if any files existed in a directory, would I do the following?Code:If System.IO.File.Exists("C:\\test.txt") = True Then
orCode:If System.IO.File.Exists("C:\\*.txt") = True Then
Thanks,Code:If System.IO.File.Exists("C:\\*.*") = True Then
Jon
No activity results to display
Show More
Leave a comment: