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: 

Parameters and Properties

10 REPLIES 10
Reply
Message 1 of 11
Anonymous
393 Views, 10 Replies

Parameters and Properties

Hi all

2 Quick questions on parameters and properties:

1. Is it possible to change the value of a custom property? I found User
parameters, Table parameters and Model parameters, but nothing on Custom
Properties.

2. Why, when I access a user parameter (for example called "comp") using
oParamsUser.Item("comp").Value

the value that is returned is 10x smaller than it should be?

Is this the cm - mm issue? The parameter is defined as mm.

Thanks

--
______________
Rui
www.cadmais.pt
10 REPLIES 10
Message 2 of 11
avbuiten
in reply to: Anonymous

A1: look at post titled: "Inventor/VB(A)/Class to handle Document Properties"

A2: Values are in CM, Expressions might be in MM
Message 3 of 11
Anonymous
in reply to: Anonymous

> A2: Values are in CM, Expressions might be in MM

Let me see if I get this: even though I input a parameter in the model as
mm, the value reported by VBA will always be in cm?

Is there a table with this correspondence, ie: length dimensions are in cm,
mass in kg, etc?

Thanks

--
______________
Rui
www.cadmais.pt


"avbuiten" wrote in message
news:f1a16ec.0@WebX.maYIadrTaRb...
> A1: look at post titled: "Inventor/VB(A)/Class to handle Document
Properties"
>
Message 4 of 11
avbuiten
in reply to: Anonymous

See Inventor Help, search for "Edit box reference"
These are expressions you can use from within the UI.

Internally length values are always stored in CM.
Don't know about other measurements, but i's fairly easy to explore the bbject structures to see how and what they are stored.
Message 5 of 11
Anonymous
in reply to: Anonymous

Thanks

--
______________
Rui
www.cadmais.pt


"avbuiten" wrote in message
news:f1a16ec.2@WebX.maYIadrTaRb...
> See Inventor Help, search for "Edit box reference"
> These are expressions you can use from within the UI.
> Internally length values are always stored in CM.
> Don't know about other measurements, but i's fairly easy to explore the
bbject structures to see how and what they are stored.
>
Message 6 of 11
Anonymous
in reply to: Anonymous

I tried getting a custom parameter from a part using:

Dim oProps As PropertySets
Set oProps = oPeça.PropertySets

Dim oParam As PropertySet
Set oParam = oProps.Item("dims")

but i get the following error:
"ActiveX component can't create object"

Any ideas?

Thanks
--
______________
Rui
www.cadmais.pt


"Rui" wrote in message
news:690AF04ABB14A00F438C7BAE025BCBE3@in.WebX.maYIadrTaRb...
> Hi all
>
> 2 Quick questions on parameters and properties:
>
> 1. Is it possible to change the value of a custom property? I found User
> parameters, Table parameters and Model parameters, but nothing on Custom
> Properties.
>
> 2. Why, when I access a user parameter (for example called "comp") using
> oParamsUser.Item("comp").Value
>
> the value that is returned is 10x smaller than it should be?
>
> Is this the cm - mm issue? The parameter is defined as mm.
>
> Thanks
>
> --
> ______________
> Rui
> www.cadmais.pt
>
>
>
Message 7 of 11
paulschuepbach
in reply to: Anonymous

Anton, Rui,

well, this is not generally CM - in sheetmetal it's MM and I think in threades holes the drill-diameter is im MM too (any confusion with all the rest...). Have a look at the UnitsOfMeasure Property. With that you can 'convert' any input to the acatual units, so you go around the 'factor 10' problem. Hope this helps.

Best,

Paul
Message 8 of 11
avbuiten
in reply to: Anonymous

OOPS. Sorry for my mistake. Hope not too many holes are bored too small.
Anton
Message 9 of 11
avbuiten
in reply to: Anonymous

I think oParam variable is not of type PropertySet but Property. You may use type Object as well although i wouldn't do that.
See for more details the topic "Get Part Enabled Information"
Message 10 of 11
Anonymous
in reply to: Anonymous

That was it.

I used the following code to set the value of custom property "dims" to the
value of a variable tDims:
Dim oProps As PropertySets
Set oProps = oPeça.PropertySets

Dim oUserDefParam As PropertySet
Set oUserDefParam = oProps.Item("User Defined Properties")

Dim oParam As Property
Set oParam = oUserDefParam.Item("dims")

oParam.Value = tDims


Thanks for the imput. Now to see about the units of measurement.......or
maybe I'll leave the factor 10, it's Friday and it's working....


--
______________
Rui
www.cadmais.pt


"avbuiten" wrote in message
news:f1a16ec.7@WebX.maYIadrTaRb...
> I think oParam variable is not of type PropertySet but Property. You may
use type Object as well although i wouldn't do that.
> See for more details the topic "Get Part Enabled Information"
>
Message 11 of 11
Anonymous
in reply to: Anonymous

Paul,

 

I think all length units are handled as CM
regardless of the type of feature or part.

 

Inventor's internal units are based on the cgrs
system (cm, gram, radian, second).


--
Sean Dotson, PE

href="http://www.sdotson.com">http://www.sdotson.com

Check the Inventor
FAQ for most common questions

href="http://www.sdotson.com/faq.html">www.sdotson.com/faq.html

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


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Anton,
Rui,

well, this is not generally CM - in sheetmetal it's MM and I think in
threades holes the drill-diameter is im MM too (any confusion with all the
rest...). Have a look at the UnitsOfMeasure Property. With that you can
'convert' any input to the acatual units, so you go around the 'factor 10'
problem. Hope this helps.

Best,

Paul

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

Post to forums  

Autodesk Design & Make Report