I am attempting to add linear dimension lines to a entity collection. There does not appear to be a function for doing this like there are for guide lines and other entities (SUEntitiesAdd…), so how is this done? If this is not possible in the current version of the SKD, is there a way to add text to an entity collection?
I see how to create a dimension line, but how do I add it to the entity collection? Does merely attaching it to an entity via an SUInstancePathRef cause it to be a part of the entity collection? The Ruby API has this: http://ruby.sketchup.com/Sketchup/Entities.html#add_dimension_linear-instance_method, but the C SDK does not appear to have this method listed in the documentation.
NO. A dimension object can span between two separate objects (which can be nested in separate components.)
I do not know for sure. Perhaps it’s function was overlooked ?
So if dimension lines are not possible, what about free floating text? This method seems to be missing from the C SDK as well. If the C SDK is not feature complete, is there still a way to get the old C++ SDK?
It may be that they wish them to be made in a LayOut document:
When they are, they’d be in paperspace, so would only be a member of the document’s (or page’s) entities collection.
This is the leader “callout” object. Yes I do not see it listed anywhere in the SketchUp C API.
Nor do I see the view-based screen note object, ie, the equiv. of
nor any function equiv. of
The old C++ API is about to be deprecated. No more work fixing it or adding to it will be done. It is also likely that it’s libraries will cease to be compiled and/or distributed for newer SketchUp versions.
ADD: The SkpWriter.dll has long been deprecated. But the C++ SketchUpReader.dll is still distro’d with the SDK in the “deprecated” folder.
Have you tried using the SUDimensionLinearToDimension to cast your SULinearDimensionRef to an SUDimensionRef, then used SUDimensionToEntity to get an SUEntityRef? You should be able to then add that SUEntityRef to an entity collection. It sounds like it would be nice for us to add a SUDimensionLinearToEntity method to cast SULinearDimensionRef directly to SUEntityRef.
Hope this helps,
I do not see how that helps. Entity collections do not have a generic add entity function either. Can you cast any generic entity to a component instance then add it via the add component instance function? http://extensions.sketchup.com/developer_center/sketchup_c_api/sketchup/entities_8h.html#a56a63c45cd09b148ca9d2c0bbf1d256e
I have just tested casting a linear dimension to a dimension to an entity to a component instance, and it does not work. It seems there is no way to add an arbitrary entity to an entity collection.
I didn’t think there was. It would be beyond the norm to have to do it this way.
These SDK classes need C “factory” functions, that wrap the C++ object constructors, that create them as members of the proper C++ entities collection.
(Same as in the Ruby API.)
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.