Message 1 of 2
A sample please !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I find a sample for fix constrainte rebar to other rebar !
Thank you provide sample ,
i at all dont understand documentation API !
Here my code for fix a constraint of a rebar forme '00' to other rebar forme '00' 'Class Rebar' at 2 inchs THEN it don't work.
ANY sample finded !
public Result Commande4(
UIApplication uiapp, object model)
{
{
Rebar st = TcmPick.saisiracier(uiapp.ActiveUIDocument, "ttt2");
{
Reference refr = uiapp.ActiveUIDocument.Selection.PickObject(ObjectType.PointOnElement);
if (refr != null)
{
RebarConstraintsManager rbcst = st.GetRebarConstraintsManager();
IList<RebarConstrainedHandle> ilhst = rbcst.GetAllConstrainedHandles();
foreach (var lil in ilhst)
{
var cc = lil.GetHandleType();
cc = cc;
}
List<Reference> lrefr = new List<Reference>();
lrefr.Add(refr);
foreach (RebarConstrainedHandle ilhprx0 in ilhst)
{
RebarHandleType cc = ilhprx0.GetHandleType();
{
var Lccl = rbcst.GetConstraintCandidatesForHandle(ilhprx0, refr);
if (Lccl.Count == 0)
Lccl = rbcst.GetConstraintCandidatesForHandle(ilhprx0);
foreach (RebarConstraint ccl in Lccl)
{
if (ccl.GetConstraintType() == RebarConstraintType.ToOtherRebar)
{
var cttarget = ccl.GetTargetRebarConstraintType();
if ((cttarget != TargetRebarConstraintType.HookBend) && (cttarget != TargetRebarConstraintType.BarBend))
{
ccl.SetDistanceToTargetRebar(0.3048 * 2);
bool capasse = false;
try
{
ccl.ReplaceReferenceTargets(ilhprx0, lrefr, false, 0.3048 * 2);
capasse = true;
}
catch (Exception ee)
{
ee = ee;
}
try
{
ccl.ReplaceReferenceTargets(ilhprx0, lrefr, true, 0.3048 * 2);
capasse = true;
}
catch (Exception ee)
{
ee = ee;
}
if (capasse)
{
capasse = capasse;
}
}
}
}
}
}
}
}
Thank you provide sample.
Thank.