Script to create connectors automatically
Hello,
I am trying to automate a task and need some guidance.
In a model with various components, I have the guide points of the fasteners. Some fasteners connect more than two components.
I am looking to create the connectors automatically by selecting the points and export the connectors' information (cfast id and coordinates, attached elements).
The final goal is to create automatically more than 8000 fasteners and extract their information, in order to use them for fastener analysis.
Thanks for your help
N.
Find more posts tagged with
Hello
Yes I did.
For a small number of fasteners (less than 100) it is doable to use that command.
If the number of fasteners increases, checking this process is more prone to error.
I have the following script.
By intersecting fastener vector lines with the parts' surfaces, the nodes and fasteners are created.
The problem is that it needs the surfaces to be in one component, the mesh in another and the lines in another.
Again, for a small model, it is doable, but scalling up, with 30/40 components, it is not.
What is your opinion? How could I improve this?
Thanks for your help.
Regards,
N.
*setedgedensitylinkwithaspectratio -1
*elementorder 1
*startnotehistorystate {selectsurface}
*createmarkpanel surface 1 2
*interactiveremeshsurf 1 4 2 2 2 1 1
*set_meshfaceparams 0 2 2 0 0 1 0.5 1 1
*set_meshedgeparams 0 8 1 0 0 0 5 0 0
*set_meshedgeparams 1 8 1 0 0 0 5 0 0
*set_meshedgeparams 3 8 1 0 0 0 5 0 0
*automesh 0 2 2
*set_meshfaceparams 0 2 2 0 0 1 0.5 1 1
*set_meshedgeparams 0 9 1 0 0 0 5 0 0
*automesh 0 2 2
*set_meshfaceparams 0 2 2 0 0 1 0.5 1 1
*set_meshedgeparams 0 10 1 0 0 0 5 0 0
*automesh 0 2 2
*set_meshfaceparams 0 2 2 0 0 1 0.5 1 1
*set_meshedgeparams 0 9 1 0 0 0 5 0 0
*automesh 0 2 2
*storemeshtodatabase 1
*ameshclearsurface
*endnotehistorystate {Automesh surfaces}
*setdisplayattributes 2 0
hello tinh the above one is from command file which is element creation from fine 2mm to 4mm element on surface.but my question is I want to use this automation to all other surface which are bigger in size and I want to edit mesh based on the height. will you please guide me how can it will be.this code is for 20mm height square surface.
Tinh,
Can you help me to separate this string
This is metadata from cad Import
{lines 929 .ALTAIR.HW.STEP.ColorId int 1} {lines 929 {.ALTAIR.HW.STEP.Curve Font} string CENTERLINE} {lines 929 {.ALTAIR.HW.STEP.Original Name} string {Z Vector - M8_xx8585/xx8584}} {lines 929 .ALTAIR.HW.STEP.Name string {Z Vector - M8_xx8585_xx8584}} {lines 929 .ALTAIR.HW.STEP.OriginalId int 44087} {lines 929 .ALTAIR.HW.STEP.TAG string {Z Vector - M8_xx8585/xx8584}} {lines 929 .ALTAIR.HW.STEP.ShowPublishedAndLineType int 1536} {lines 929 .ALTAIR.HW.STEP.Color:Blue double 1.0} {lines 929 .ALTAIR.HW.STEP.Color:Green double 1.0} {lines 929 .ALTAIR.HW.STEP.Color:Red double 1.0} {lines 929 .ALTAIR.HW.STEP.Thickness double 0.129999995232}
Lines 929 (929) is a line number which will change and I need to get the {Z Vector - M8_xx8585/xx8584} and obtain M8, xx8585 and xx8584 into a separate parameters
Thank you
Tinh,
Can you help me to separate this string
This is metadata from cad Import
{lines 929 .ALTAIR.HW.STEP.ColorId int 1} {lines 929 {.ALTAIR.HW.STEP.Curve Font} string CENTERLINE} {lines 929 {.ALTAIR.HW.STEP.Original Name} string {Z Vector - M8_xx8585/xx8584}} {lines 929 .ALTAIR.HW.STEP.Name string {Z Vector - M8_xx8585_xx8584}} {lines 929 .ALTAIR.HW.STEP.OriginalId int 44087} {lines 929 .ALTAIR.HW.STEP.TAG string {Z Vector - M8_xx8585/xx8584}} {lines 929 .ALTAIR.HW.STEP.ShowPublishedAndLineType int 1536} {lines 929 .ALTAIR.HW.STEP.Color:Blue double 1.0} {lines 929 .ALTAIR.HW.STEP.Color:Green double 1.0} {lines 929 .ALTAIR.HW.STEP.Color:Red double 1.0} {lines 929 .ALTAIR.HW.STEP.Thickness double 0.129999995232}
Lines 929 (929) is a line number which will change and I need to get the {Z Vector - M8_xx8585/xx8584} and obtain M8, xx8585 and xx8584 into a separate parameters
Thank you
Use 'split'
Or 'string range'
Ex:
lassign [split {Z Vector - M8_xx8585/xx8584} /] temp P1
lassign [split $temp _] temp P2
lassign [split $temp -] temp P3
puts '$P3\n$P2\n$P1'
Did you use panel 1d>connectors>spot?