Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.8K Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

[?] Get the value of an Entity's property ?

Posted 9 years ago
POSTED BY: Janos Lobb
2 Replies

It's hard to tell exactly what you're doing, since you're copying plain text instead of InputForm, which would be more helpful, but it looks to me like you're a) not using any correct syntax to request a property value and b) somehow also including the "Word" type entity "region" instead of the "Region" property associated with physical systems. Any of these will get you what you want, I think:

(Local2) In[5]:= 
Entity["PhysicalSystem", "RectangularBarMagnet"]["Region"]

(Local2) Out[5]= Cuboid[{-(QuantityVariable["a","Length"]/2), -(
   QuantityVariable["b","Length"]/2), -(QuantityVariable[
   "c","Length"]/2)}, {QuantityVariable["a","Length"]/2, 
  QuantityVariable["b","Length"]/2, QuantityVariable["c","Length"]/2}]

(Local2) In[10]:= 
Entity["PhysicalSystem", "RectangularBarMagnet"][
 EntityProperty["PhysicalSystem", "Region"]]

(Local2) Out[10]= Cuboid[{-(QuantityVariable["a","Length"]/2), -(
   QuantityVariable["b","Length"]/2), -(QuantityVariable[
   "c","Length"]/2)}, {QuantityVariable["a","Length"]/2, 
  QuantityVariable["b","Length"]/2, QuantityVariable["c","Length"]/2}]

(Local2) In[6]:= EntityValue[
 Entity["PhysicalSystem", "RectangularBarMagnet"], "Region"]

(Local2) Out[6]= Cuboid[{-(QuantityVariable["a","Length"]/2), -(
   QuantityVariable["b","Length"]/2), -(QuantityVariable[
   "c","Length"]/2)}, {QuantityVariable["a","Length"]/2, 
  QuantityVariable["b","Length"]/2, QuantityVariable["c","Length"]/2}]

(Local2) In[9]:= EntityValue[
 Entity["PhysicalSystem", "RectangularBarMagnet"], 
 EntityProperty["PhysicalSystem", "Region"]]

(Local2) Out[9]= Cuboid[{-(QuantityVariable["a","Length"]/2), -(
   QuantityVariable["b","Length"]/2), -(QuantityVariable[
   "c","Length"]/2)}, {QuantityVariable["a","Length"]/2, 
  QuantityVariable["b","Length"]/2, QuantityVariable["c","Length"]/2}]
POSTED BY: Alan Joyce
Posted 9 years ago

Alan,

Thanks a lot. Now I start to "see". :-) Best, János

POSTED BY: Janos Lobb
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard