Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sheet Metal Extents

87 REPLIES 87
Reply
Message 1 of 88
Anonymous
2691 Views, 87 Replies

Sheet Metal Extents

I cannot understand why Autodesk does not have the sheet metal extents and
sheet metal style as parameters so we do not have to resort to VBA or
addins. (I know of the great program Yippee etc.)

Anyways, I have included the code from someone at Autodesk for the length
and width. What I do not understand is where to put this code so that it
will be updated every time the sheet metal part is changed. Is there a way
to do this? Do I place it in my sheet metal template file? I am a little
unclear as to where I put it. Also does somebody have the code for the
style?

(I know how to put it in the template file and run the macro but it does not
update unless this is done.)

It has been a while since I have done any programming in VB and have never
done any inside Inventor so any help on this would be greatly appreciated!.

**************************************************************
Public Sub extents_to_custom_props()
Dim objpartDoc As PartDocument

Set objpartDoc = ThisApplication.ActiveDocument

Dim objCompDef As SheetMetalComponentDefinition

Set objCompDef = objpartDoc.ComponentDefinition

Dim fpBox As Variant

Set fpBox = objCompDef.FlatPattern.Body.RangeBox

Dim width As Double

Dim length As Double


length = fpBox.MaxPoint.X - fpBox.MinPoint.X

width = fpBox.MaxPoint.Y - fpBox.MinPoint.Y


Dim objUOM As UnitsOfMeasure

Set objUOM = objpartDoc.UnitsOfMeasure


Dim strLength As String

Dim strWidth As String


strLength = objUOM.GetStringFromValue(length,
UnitsTypeEnum.kDefaultDisplayLengthUnits)

strWidth = objUOM.GetStringFromValue(width,
UnitsTypeEnum.kDefaultDisplayLengthUnits)


Call MsgBox("Width = " + strWidth + vbCrLf + "Length = " + strLength,
vbOKOnly, "Sheet Metal Flat Pattern")


Call Create_ext_prop("width", strWidth)

Call Create_ext_prop("length", strLength)



End Sub




Sub Create_ext_prop(prop As String, prop_value As String)


Dim opropsets As PropertySets

Dim opropset As PropertySet

Dim oUserPropertySet As PropertySet


Set opropsets = ThisApplication.ActiveDocument.PropertySets


For Each opropset In opropsets

If opropset.Name = "Inventor User Defined Properties" Then Set
oUserPropertySet = opropset

Next opropset


' If Property does not exist then add the new Property

On Error Resume Next

Call oUserPropertySet.Add(prop_value, prop)

' Try to set the Property value if it already exists


For i = 1 To oUserPropertySet.Count

If oUserPropertySet.Item(i).Name = prop Then
oUserPropertySet.Item(i).Value = prop_value

Next i


End Sub

*******************************************************************************


--
Rob
Inventor 11 SP2 Build 344a
Vault 5.0 Build 11.1.145.0


--
Rob
Inventor 11 SP2 Build 344a
Vault 5.0 Build 11.1.145.0
87 REPLIES 87
Message 41 of 88
karthur1
in reply to: Anonymous

Still having trouble running the install_64.bat. When I run it (run as administrator), I get a message that complains that it cant find the sheetmetalextents.dll although it is in the same directory as the install file. I tried editing the bat file by appending the path for the sheetmetalextents.dll, but that did not work either. The path that I added was c:\Program Files\Autodesk\Macros\SMExtents. When I do that it says the "Unable to locate input assembly 'C:\Program'.

Attached is a screen shot of what I see when I run the install_64.bat as an administrator. What do I need to do so that it finds the .dll file?

Update..... In Windows 7, I had to change the UAC setting to "Never Notify". After I did that and restarted the computer, I could then run the install_64.bat. Edited by: KArthur1 on May 19, 2010 10:51 AM
Message 42 of 88
Anonymous
in reply to: Anonymous


Try putting Quotes "" around
face="Times New Roman">c:\Program Files\Autodesk\Macros\SMExtents  
Dos doesn't like spaces.


--
KWiKMcad
Kent Keller


style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
Still
having trouble running the install_64.bat. When I run it (run as
administrator), I get a message that complains that it cant find the
sheetmetalextents.dll although it is in the same directory as the install
file. I tried editing the bat file by appending the path for the
sheetmetalextents.dll, but that did not work either. The path that I added was
c:\Program Files\Autodesk\Macros\SMExtents. When I do that it says the "Unable
to locate input assembly 'C:\Program'.
Attached is a screen shot of what I
see when I run the install_64.bat as an administrator. What do I need to do so
that it finds the .dll file? Update..... In Windows 7, I had to change the UAC
setting to "Never Notify". After I did that and restarted the computer, I
could then run the install_64.bat. Edited by: KArthur1 on May 19, 2010 10:51
AM
Message 43 of 88
IODesign07
in reply to: Anonymous

Hi Brian,

I've been using the sheet metal extents program you had provided to me back in June 2009, and its been working great for Inventor 2010 w/ Windows XP 32-bit. I've been using it for awhile with no glitches. I've just upgraded a computer to Windows 7 64-bit (still with Inventor 2010), and the program doesn't seem to want to load. I'm wondering if you have a more up-to-date version than the one I've been using?

I appreciate it,

Laurie
Message 44 of 88
karthur1
in reply to: Anonymous

Laurie,
This past week, I have installed the SMExtents add-in on 9 different computers... all running R2010 on Win7x64. Windows makes is a little touchous about installing this, but it can be done. Here are a few things to look out for.
1. Make sure you have the latest version of SMextents.
2. In widows turn the UAC off (move the slider all the way to the bottom). You will have to reboot after you do this.
3. When you run the Install_64.bat file, right click on it and "Run as Administrator".
4. To make sure that this loads, start Inventor and go to the add-ins and see if it is listed there. Make sure the Load Behavior column says "Startup/Loaded"... otherwise it will not work.

You may see an error message about the Registering an unsigned assembly when you run the install file, but this is normal and you can ignore it.
If you are still having trouble, post back.
Message 45 of 88
karthur1
in reply to: Anonymous

> {quote:title=nelson_c wrote:}{quote}I'm having trouble installing this add-on. I just installed Inventor 2010. I just found this add-on, I didn't have it installed in 2009.
>
> Attached is a screen capture of the error messages I get.
>
> Can anybody point me in the right direction? I'd really love to get this working. Nelson,
Try copying the file to a local folder and run the .bat from there.

Kirk
Message 46 of 88
RobJV
in reply to: Anonymous

I know I am responding to a very old post but I don't think this was answered. You don't have to change thousands of files. I also use different nomenclature for my non-sheetmetal items. I use "G_L" and "width" and "material".

All you have to do is use substitution inside of your partslist. Under G_L simply use: when exists use SheetMetalLength, under width use: SheetMetalWidth, and under material use: SheetMetalStyle.



Rob
Message 47 of 88
janitor1
in reply to: karthur1

What is the latest or best version of "SheetMetalExtents" by Brian Ekins? I need it to run IV2011 64 bit on Windows 7.

 

I see the version in the posting of 11-14-2008 from Brian himself (this is the latest one I can find from him)

 

and the 07-31-2009 version from Rob that is apparantly from some where other than this thread

 

and 04-30-2010 from Kent that says it is only the dll and just run the batch file Brian included (this post mentions overwriting the dll, which is beyond my knowledge. Note: I understand that tinkering with dlls can cause problems and hope to avoid changing the dlls)

 

Please direct me to the best version for my use. I mostly just need to print the "sheet metal rule" from the "sheet metal defaults" in the title block of my sheet metal drawings.

 

Also, any guidance for the install is appreciated.

 

Thanks in advance for any help.

Steve

Message 48 of 88
RobJV
in reply to: janitor1

Just moved to Win 7 Inventor 2011 and am using the attached file.  I know it works but have not fully tested yet as there may be some rebuild-alls necessary on previously made sheetmetal files - still testing.

Message 49 of 88
ekinsb
in reply to: RobJV

Let me know if anyone find any problems and I'll take a look at it, although I would expect it to still work.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 50 of 88
pauldoubet
in reply to: ekinsb

Brian,

 

I am using the Sheet Metal Extents Add-In with Inventor Pro 2011. I have run in to some problems with iParts used in iAssemblies. If I have more than (1) instance of the iPart from the same iPart file and each instance is a different row in the table I am getting the same flat pattern size for both parts. I have tried some work arounds but none have worked at this point. I also get numerous error messages if I update the assembly that contains the iAssemblies.

 

Do you know of a solution to this problem?

 

Thanks, Paul 

Message 51 of 88
karthur1
in reply to: ekinsb

Brian,

Ran into a slight problem when using this add-in.  See the video here.  http://screencast.com/t/UB4UWWSNM

 

What I have done is I derived in a sheetmetal part.  This part has the Sheetmetallength and sheetmetalwidth parameters in it.  When I create the flat pattern in this new part, a new sheetmetallength and sheetmetalwidth is created with the "_1" appended to the name. Notice that the update button is available.  Each time the update is done on the part, a new " _x is added to the parameter name.  The problem is eventually, the parameter name is too long for vault and an error is given when the part is added to vault.

 

The only way that I can get the update button to become greyed out is to undo the update, then it becomes unavailable.

 

Behaves the same in both 2011 x64 and in 2012 x64.

 

Here is a screenshot of the parameter list of the part that would not go into vault.  http://screencast.com/t/pWzyoJC3FW

Message 52 of 88
RobJV
in reply to: karthur1

Hi karthur1,

 

I use this addin on a daily basis and also used derived parts extensively.  I have never noticed this.  I just did a test on it and I don't have the same issues you are experiencing. 

 

Something is definitely wrong with your part as the paramters sheetmetallength and sheetmetalwidth should appear in your variable list BEFORE DERIVING.  I wonder if you are using an older version of this program or you deleted the parameters before deriving?

 

(When they are not there, then the file that is derived in will take those names and cause problems as you can see.)

 

Even if I change a part from standard part to sheetmetal part, those parameters automatically appear.  (As a side note, they also exist in my template file.)

 

 

Rob

Message 53 of 88
karthur1
in reply to: RobJV


..

Something is definitely wrong with your part as the paramters sheetmetallength and sheetmetalwidth should appear in your variable list BEFORE DERIVING.  I wonder if you are using an older version of this program or you deleted the parameters before deriving?

 

(When they are not there, then the file that is derived in will take those names and cause problems as you can see.)

 

Even if I change a part from standard part to sheetmetal part, those parameters automatically appear.  (As a side note, they also exist in my template file.)


Rob,

Ran into this again today.

 

My ipt template does not have those parameters there.  When I derive in a sheetmetal part into it, I get these bloated parameters, but if I manuall add them BEFORE I derive it in I dont.

 

Thanks for the heads up.  Hopefully anyone have a similar problem will see this post.

 

I am using Sheetmetal extents version 2.1, btw.

 

Kirk

Message 54 of 88
Toolish
in reply to: karthur1

I am trying to install Sheet Metal extents on a Windows 7 64 Bit machine running Inventor Professional 2013.

 

When looking at the add-in list it says the add-in is loaded but the functionality is not there.  It does not seem to create the sheet metal extents as it has previously.

 

Is anyone else having this issue?  Any ideas greatly appreciated.

 

 

Message 55 of 88
RobJV
in reply to: Toolish

I have same setup but have not installed 2013 yet.  Will be doing soon.   Does anything get written to your files at all?  I assume you ran this addin without problems on previous release(s)?  If nothing happens at all with addin, it may be worth writing Brian Ekins an email to see if there is any reason the addin should not work on 2013.

 

Rob

Message 56 of 88
Toolish
in reply to: karthur1

Yes it had worked fine in previous versions.  I ma not sure if it is an install issue or what is going in.  It says the add in is loaded when I check the add in manager but then when I create a sheet metal part and do the flat pattern then check the custom properties nothing is there.

 

Message 57 of 88
ekinsb
in reply to: Toolish

I haven't tried the add-in on Inventor 2013 yet.  I'll try and take a look at this week.

 

I did look at the program a few months ago when a problem was reported but we were unable to reproduce the issue at that time so I didn't do any more with it.  If any of you have any know issues and can send me full reproducable cases I'll take a look at them.

 


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 58 of 88
RobJV
in reply to: Toolish

I will be installing 2013 in the next week and will let you know if I too have any issues.  Looks like Brian Ekins will let us know as well.

 

Rob

Message 59 of 88
Mike.Wohletz
in reply to: Anonymous

Someone else on the forum had this issue and I recompiled this for them with .NET 3.5 as the target instead of 2.0 and the problem was solved. I am running 2013 with the 3.5 target version and have had no problems.
Message 60 of 88
karthur1
in reply to: Mike.Wohletz

Mike,

Did you post the recompiled version somewhere?  It doesnt work for me in 2013 either.

 

Kirk

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report