API - Panel Cuts

API - Panel Cuts

Anonymous
Not applicable
1,160 Views
5 Replies
Message 1 of 6

API - Panel Cuts

Anonymous
Not applicable

Guys, can you tell why this code is not working ?

And what is the significance of row ((1))  ?

 

 

Set pan_cut = robapp.Project.Structure.Results.FiniteElems.PanelCuts.Create


RView.Projection = I_VP_XY_3D

RView.ParamsPanelCut.CurrentResult = Cells(11, 2).Value
RView.ParamsPanelCut.IntegralValue = True


RView.ParamsPanelCut.Smoothing = I_VFMST_NO_SMOOTHING

RView.ParamsPanelCut.Layer = I_VFMLT_MIDDLE                                           ((1))
RView.ParamsPanelCut.Descritpions = I_VDDT_TEXT

RView.ParamsPanelCut.Filling = I_VDFT_FENCE
RView.ParamsFeMap.CurrentResult = Cells(11, 2).Value
RView.ParamsPanelCut.Position = I_VDPT_IN_PLANE

RView.Redraw 1
pan_cut.DefinitionType = I_PCDT_LIMITED_PLANE
pan_cut.Point1.Set x1, y1, z1
pan_cut.Point2.Set x2, y2, z2
robapp.Project.Structure.Results.FiniteElems.PanelCuts.Store pan_cut, npcname1
pan_cut.Active = True
pan_cut.Color = 3
RView.Redraw 1

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

marcinrakus
Autodesk
Autodesk
Accepted solution

Hi,

 

There is a problem with API concerning panel cuts.

If You have problem with displaying the cut there is some trick, that may help You:

 

https://forums.autodesk.com/t5/robot-structural-analysis-forum/robot-api-panel-cut-parameters/td-p/7...

 

And as regards position on layer - the difference should be observed when analysis of stresses, which are dependent on layer.

 

Regards,

Marcin

Message 3 of 6

jmmarin
Advocate
Advocate


Dear @Anonymous,

 

I am trying to do something like your code. Could you kindly send to me the rest of the code?. I have some doubts with the declaration of "Rview" in your code. 

 

Thank you in advance. Regareds.

0 Likes
Message 4 of 6

Anonymous
Not applicable

Hi

 

For creating panel cuts you can use this code. Please share if any modifications can be done.

 

Sub CommandButton1_Click()

Dim robapp As RobotApplication
Set robapp = New RobotApplication


Dim x1 As Double

Dim x2 As Double

Dim y1 As Double

Dim y2 As Double

Dim z1 As Double

Dim z2 As Double

Dim n As Integer

n = Cells(8, 2).Value


Cells(1, 1) = "PANEL CUT API"

x1 = Cells(5, 2).Value
y1 = Cells(6, 2).Value
z1 = Cells(7, 2).Value

x2 = Cells(5, 3).Value
y2 = Cells(6, 3).Value
z2 = Cells(7, 3).Value

Dim npcname1 As String

npcname1 = Cells(4, 6)

Dim RView As IRobotView3
Set RView = robapp.Project.ViewMngr.GetView(n)

RView.ParamsFeMap.Direction = I_VFMLST_CARTESIAN_ALONG_X


Dim pan_cut As RobotPanelCut

Set pan_cut = robapp.Project.Structure.Results.FiniteElems.PanelCuts.Create


RView.Projection = I_VP_XY_3D

RView.ParamsPanelCut.CurrentResult = Cells(11, 2).Value
RView.ParamsPanelCut.IntegralValue = True


RView.ParamsPanelCut.Smoothing = I_VFMST_NO_SMOOTHING

RView.ParamsPanelCut.Layer = I_VFMLT_MIDDLE
RView.ParamsPanelCut.Descritpions = I_VDDT_TEXT

RView.ParamsPanelCut.Filling = I_VDFT_FENCE
RView.ParamsFeMap.CurrentResult = Cells(11, 2).Value
RView.ParamsPanelCut.Position = I_VDPT_IN_PLANE

RView.Redraw 1
pan_cut.DefinitionType = I_PCDT_LIMITED_PLANE
pan_cut.Point1.Set x1, y1, z1
pan_cut.Point2.Set x2, y2, z2
robapp.Project.Structure.Results.FiniteElems.PanelCuts.Store pan_cut, npcname1
pan_cut.Active = True
pan_cut.Color = 3
RView.Redraw 1

Set robapp = Nothing


End Sub

 

Regards 

Saurav

 

Message 5 of 6

jmmarin
Advocate
Advocate

Thank you!.

 

In my opinion your approach is good so nothing to improve!. It does what required. As explained in the other reply, it seems that some parameters can not be controlled by API, but if the intention is to create parametric sections, this code run well. 

 

Regards!. 

0 Likes
Message 6 of 6

jmmarin
Advocate
Advocate

Hi @Anonymous

 

do you get to change the color of the section by using the following instruction?

pan_cut.Color = 3

I can not change the colour, it is alwayis displayed in black...

 

Regards.

Jorge

0 Likes