Access Token in Advance Steel API

Access Token in Advance Steel API

chockalingam
Advocate Advocate
1,663 Views
5 Replies
Message 1 of 6

Access Token in Advance Steel API

chockalingam
Advocate
Advocate

Hi,

I am new to advance steel API

I want to get the Object Top Level (from token) through API.

Someone please guide me in acheiving this.

 

Thanks in advance.

 

Regards,

Chockalingam

0 Likes
Accepted solutions (2)
1,664 Views
5 Replies
Replies (5)
Message 2 of 6

turbatc
Autodesk
Autodesk

Hi,

 

I am not sure I understood correct what exactly means "Object Top Level (from token)"?

Could you please give me more details about that?

 

Regards,

Constantin



Constantin T
Principal Engineer
0 Likes
Message 3 of 6

chockalingam
Advocate
Advocate

In Advance steel when i double click the label, there is a option to select "Object Top Level" for label content.

I want to access that object through API.

I hope i explained my requirement clearly this time.

 

Regards,

Chockalingam

0 Likes
Message 4 of 6

turbatc
Autodesk
Autodesk
Accepted solution

Hi,

 

Currently, it is not possible to access the detail object through the API.

We will add an issue to make this workflow possible in the future.

A workaround will be to get the extents from the model object then calculate the bottom and the top level.

 

Sample code:

Autodesk.AdvanceSteel.DocumentManagement.DocumentManager.lockCurrentDocument();
Autodesk.AdvanceSteel.CADAccess.TransactionManager.startTransaction();

Autodesk.AdvanceSteel.CADLink.Database.ObjectId objectId = UserInteraction.SelectObject();
FilerObject pObject = DatabaseManager.Open(objectId);
if(pObject.IsKindOf(FilerObject.eObjectType.kAtomicElem))
{
	AtomicElement pAtomic = (pObject as AtomicElement);
	Autodesk.AdvanceSteel.Geometry.Point3d minPoint = pAtomic.GeomExtents.MinPoint;
	Autodesk.AdvanceSteel.Geometry.Point3d maxPoint = pAtomic.GeomExtents.MaxPoint;

	double objectBottomLevel = minPoint.z;
	double objectTopLevel = maxPoint.z;
}

Autodesk.AdvanceSteel.CADAccess.TransactionManager.endTransaction();
Autodesk.AdvanceSteel.DocumentManagement.DocumentManager.unlockCurrentDocument();


Constantin T
Principal Engineer
0 Likes
Message 5 of 6

chockalingam
Advocate
Advocate

Hi Constantin T,

Thanks for your reply.

DatabaseManager.Open(objectId) is always returning null for me.

I am trying to select the object inside the view box in drawing.

Is there any way to overcome this issue.

 

Thanks in advace.

 

Regards,

Chockalingam.

 

0 Likes
Message 6 of 6

turbatc
Autodesk
Autodesk
Accepted solution

Hi,

 

Currently Advance Steel API supports only model objects.
You cannot access the objects from a detail drawing.



Constantin T
Principal Engineer
0 Likes