Jump to content
Developer Wiki and Function Reference Links ×

Ungrouping custom objects (Plugins)


LarryO

Recommended Posts

Does anyone know how to get a Wide Flange object ungrouped?

This command is not having the desired effect. HUngroup(Beam_Handle);

When ungrouping manually one would receive a dialog inquiring if you are sure that you want to ungroup high-level objects.

Is there a boolean variable I need to preset to TRUE prior to invoking HUngroup?

 

DSelectAll;

BeginXtrd(0,600);

Beam_Handle:=CreateCustomObject('Wide Flange',0,0,0);


HUngroup(Beam_Handle);

 

EndXtrd;

Beam_Handle := LNewObj;

Rotate3D(#-0.0000000000000d,#90.00000000000d,#30.0000000000000d);
 

Locus3D(0,0,0);

Link to comment

It is most likely that you are not getting a handle to the Wide Flange object. 


Normally objects are not created during the running of a script but rather regenerated and created at the conclusion of the script.

 

Try adding an AlrtDialog(Concat(Beam_Handle)); before the Ungroup and see what you get. If you get 0, then the object was not initialized before you tried to ungroup it.

Link to comment

Using Message() in this manner resulted in a handle.

 

Beam_Handle:=CreateCustomObject('Wide Flange',0,0,0);

Message(Beam_Handle);
HUngroup(Beam_Handle);

 

edit: I can even move the Wide Flange before attempting to ungroup it.

Edited by LarryO
Link to comment

I think you're confusing Ungroup with Convert to Group. You want the latter method.

 

In vs, use SymbolToGroup. Looking at the function reference, getting a handle to the group is a bit complicated. See the example in the reference, though you may want to search the forum for the "waldo" method.

 

Note, using a PIO in this way has other complications. You're getting the default parameter settings for the wide flange, which may change over the course of the drawing, and this be unpredictable. You can set the parameters of the flange with SetRField, and then reset the PIO, but the reset only happens after your code runs, unless the flange is an SDK-based PIO, and and you set it's object variable 1167 to true. Possibly, setting the object's defaults before inserting will work.

Link to comment
  • 4 weeks later...

Neither function has any effect upon the WideFlange object, unlike if "ungroup" or "convert to group" is invoked by the operator.

When invoked by the operator the former triggers a dialog confirming the desire to do so upon a "high-level object" and the latter will do so without the confirmation dialog.

 

Beam_Handle:=CreateCustomObject('Wide Flange',0,0,0);
ResetObject(Beam_Handle);
message(nil=Beam_Handle);
HUngroup(LNewObj);
SymbolToGroup(Beam_Handle,1);
HMove(Beam_Handle, 50.0, 0.0);

 

This should have failed to move the object if either HUngroup or SymbolToGroup had devolved the WideFlange into a simple polyline because the handle to the WideFlange would have cease to exist if successful. Something else must be going on here. The functions do not work upon the WideFlange in a linear object script nor as a tool script.

Link to comment

@LarryO,

   I think you may be running into another fundamental problem with PIO's. The Wide Flange gets placed with your first command CreateCustomObject(), but the geometry does not exist until after your script runs. I tried to decompose it as Josh suggested, and I tried to step in and get a handle to the first object inside, and failed. From my experience, all of my attempts yielded NIL handles. That indicates the geometry does not exist when your script is running. 

 

   If you ran 2 scripts, one to create the object, and then another to convert it to a group, you would succeed. However, this is a manual approach and you are trying to achieve everything in one script. You can move the insertion point in your script, but the flange geometry is not generated until your script finishes. I don't think there is a way around this.

 

   To see what I'm talking about, try these two scripts manually, and it will work. If you combine them into one script, it will fail.

PROCEDURE FirstPass;
{ Create the Wide Flange PIO then move it into position. }
VAR
	Beam_Handle :Handle;

BEGIN
	Beam_Handle := CreateCustomObject('Wide Flange', 0, 0, 0);
	HMove(Beam_Handle, 50, 0);
END;
Run(FirstPass);

{********************}

PROCEDURE SecondPass;
{ Decompose Wide Flange PIO to a Polyline, and get handle to Polyline. } 
VAR
	H, Beam_Handle :Handle;

BEGIN
	Beam_Handle := FSActLayer;
	SymbolToGroup(Beam_Handle, 1);	{ decompose PIO }
	
	H := LActLayer; 				{ top object on active layer }
	message(H, '  ', GetTypeN(H));
END;
Run(SecondPass);

 

Raymond

 

  • Like 1
Link to comment

You can try SetObjectVariableInt(Beam_Handle, 1167, true) to force the PIO to regenerate immediately, but that only works for regenerating SDK built plug-ins. 
What’s your end goal? If it’s primarily to make an extreme of the beam, storing the flange PIO in the profile group might be the way to go. 

  • Like 1
Link to comment

Thanks, Josh.

   Ya just learned me sumthin' new. It works like a charm. I guess it's an SDK PIO.

 

PROCEDURE OnePass;
{ Create the Wide Flange PIO, move it into position, then hatch it. }
VAR
	H, Beam_Handle :Handle;

BEGIN
	Beam_Handle := CreateCustomObject('Wide Flange', 0, 0, 0);
	SetObjectVariableBoolean(Beam_Handle, 1167, true);
	HMove(Beam_Handle, 50, 0);

	SymbolToGroup(Beam_Handle, 1);		{ decompose PIO }
	
	H := LActLayer; 			{ top object on active layer }
	message(H, '  ', GetTypeN(H));
END;
Run(OnePass);

 

 

16 minutes ago, JBenghiat said:

What’s your end goal? If it’s primarily to make an extr(ud)e of the beam, storing the flange PIO in the profile group might be the way to go.

 

 Or he could use the 'Wide Flange - 3D' and avoid all the muss and fuss.

 

Thanks again,

Raymond

Link to comment

I started out attempting to use the provided plugins as a basis for creating beams in plan rather than columns as the current tools create. But I found that I wasn't able to rotate along either the X nor the Y axis only the Z. So I went onto changing the working plan in the hope that I could have the plugin align to that but it doesn't look for the active work plane and generates upon the layer plane instead. So this was my final attempt of using VWs WideFlange tools thinking that I could use the outline generated to produce a beam with the extrusion function.

I didn't want to have to start from scratch to generate all the data and the 3d outlines from the data files simply to have a beam that could be placed and adjusted as a linear object. It is actually quite tedious to create them as 3D columns then rotated them into position, measure the length in 3d space from junction centre to junction centre and then set them to their final length using the OI palette before one can get to the actual work of creating appropriate connections for each end and placing the various stiffeners and connection holes.

Ultimately I want a beam creation and connection tool(s) suitable to do structural work that can prepare linked symbols for use in manufacturing drawings.

Link to comment

The current process is as thus:

1. Receive Arch pdfs (and Structural if we're lucky, sometimes it is just notes written upon the Arch drawings).

2. Import to scale onto an empty drawing layer if the pdf is clean and doesn't bog down the interaction within the drawing file.

3. Create 2nd layer for placing our work and place lines representing beams using the pdf as a raw snap to environment before ensuring all lines terminate at centre lines, grids, and other logical points.

4. Create 3rd layer and begin by placing 3DWideFlange columns at the origin using the line lengths to set their length.

5. Convert each to a symbol utilizing the origin 0,0 and naming each symbol their unique name B1, B2, B3 ...

6. Coordinate a unique class to each symbol with a prefixed Visibility-B1, Visibility-B2, Visibility-B3 ...

7. Rotate each symbol down into the horizontal position with its origin to the top side and snapped to 0,0,0.

8. Copy and paste each beam symbol to 2nd layer replacing the line used to ascertain their length. At this point because we used symbols we can utilize different class visibility concepts to suit in presenting and creating the overall assembly and installation views.

9. Change the Z value to the elevation the beam is to be located at in the structure/assembly.

10. At this point everything is snapped to centre lines etc. and the fun begins. We cope the flanges, subtract the holes, add plates to stiffen at bearing points, insert and align bolts and add connection clips or end plates, plus occasionally a few other kinds of components.

11. All those components would also be symbolized and placed on the 3rd layer.

12. Sheets are created and named for each beam and a viewport to layer 3 is placed with the class of the representative beam visible. At which point annotation is created, front, top, bottom, end, detail and section views are taken as needed. Hence the need to have one layer for overall plan layout and another for presenting them on sheets.

13. A similar process to step 12 is required for each component part.

 

When I have a better beam function done it will compile steps 3 through 8 hopefully into one process of laying out the beams over the pdf plan. Then I will have some time to mess around with introducing components.

Link to comment

Hmmm.... OK now for the stupid question. omg When did this tool become part of the Architectural package?

I've been customizing MiniCad's 🙃 menu for so long that I failed to notice its introduction. 🙄

 

The symbol technique saves significant presentation time even for one off beams.

Having the same beam linked on two different drawing layers ensures no changes will occur to one without occurring in the other.

And being able to place each beam in a construction plan layer for orientation within the building as well as a detailing (layer) environment aligned to its origin means that viewport views do not require significant realignment of crop and annotations from prepared templates. The views of course revolve about the origin of the layer; Viewports have no means to know we want to revolve about a particular object.

And there is no chance of class settings overriding the objects within the symbol when a class is being utilized for visibility purposes.

 

I guess it would be too much to ask for a beam presentation viewport which synchronized with the Member Id to present a beam for annotating on a sheet layer? Then there wouldn't be a need for the symbolization nor the layout layer and hundreds of visibility classes. Mind you I still would need to do so for those components used in reinforcing, connecting and capping. Plus the structural member tool doesn't do coping, holes, etc. There would have to be some intermediate means to modify the structural solid, similar to resource editing symbols.

Link to comment

The tool has been around a while, but was enhanced significantly fairly recently, maybe 2020.

 

I think your requests are all fairly valid and achievable. I'm not sure who would help explore those, but perhaps @Matt Panzer can help direct.

 

As for the sheet layer views, that is all achievable via section viewports and setting the various crop, depth, and length parameters. The easiest way to see this is to set the clip cube to isolate a beam, and then right-click on a face of the clip cube and choose to create a section viewport. I'm not aware of a command that automatically creates views that isolate an object, but again, I think that's a fairly achievable request.

Link to comment
  • Vectorworks, Inc Employee
7 minutes ago, JBenghiat said:

I think your requests are all fairly valid and achievable. I'm not sure who would help explore those, but perhaps @Matt Panzer can help direct.

 

Hi @JBenghiat and @LarryO,

There's quite a lot discussed here.

Larry, can you post in the Wishlist forum the specific items you'd like the Structural Member (or Vectorworks) to be able to do?

This is the best place to put and discuss them.  Plus, others can vote them up.

Link to comment

Thanks Josh,

You are probably correct about the tool being recent. I went to use it today and came across a rather obvious omission. The script doesn't report the length in the OI palette. Some of the other physical characteristics that are reported in the WideFlange-3D tool are not there yet either. Measures that are useful when coping the ends and confirming alignments etc. It's probably still in beta development.

 

Matt,

Yes, I'll probably get around to that. It seems that what I have been poking at with VW Scripting is probably more suited to the SDK environment which I've never seemed to prioritize in learning. The companies I've worked for over the years have never had the software development as their focus.

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...